mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 02:34:40 +08:00
cmount: check for filesystem blowing up before Init is called
This commit is contained in:
parent
0384364c3e
commit
e6ffe3464c
|
@ -269,8 +269,15 @@ func mount(f fs.Fs, mountpoint string) (*mountlib.FS, <-chan error, func() error
|
|||
return errors.New("host unmount failed")
|
||||
}
|
||||
|
||||
// Wait for the filesystem to become ready
|
||||
<-fsys.ready
|
||||
// Wait for the filesystem to become ready, checking the file
|
||||
// system didn't blow up before starting
|
||||
select {
|
||||
case err := <-errChan:
|
||||
err = errors.Wrap(err, "mount stopped before calling Init")
|
||||
return nil, nil, nil, err
|
||||
case <-fsys.ready:
|
||||
}
|
||||
|
||||
return fsys.FS, errChan, unmount, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user