forked from TrueCloudLab/rclone
cmount: check for filesystem blowing up before Init is called
This commit is contained in:
parent
0384364c3e
commit
e6ffe3464c
1 changed files with 9 additions and 2 deletions
|
@ -269,8 +269,15 @@ func mount(f fs.Fs, mountpoint string) (*mountlib.FS, <-chan error, func() error
|
||||||
return errors.New("host unmount failed")
|
return errors.New("host unmount failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the filesystem to become ready
|
// Wait for the filesystem to become ready, checking the file
|
||||||
<-fsys.ready
|
// 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
|
return fsys.FS, errChan, unmount, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue