mirror of
https://github.com/restic/restic.git
synced 2025-10-10 14:31:56 +00:00
mount: Correctly return context.Canceled for interrupted syscalls
bazil/fuse expects us to return context.Canceled to signal that a syscall was successfully interrupted. Returning a wrapped version of that error however causes the fuse library to signal an EIO (input/output error). Thus unwrap context.Canceled errors before returning them.
This commit is contained in:
@@ -58,7 +58,7 @@ func (d *SnapshotsDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
|
||||
// update snapshots
|
||||
meta, err := d.dirStruct.UpdatePrefix(ctx, d.prefix)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, unwrapCtxCanceled(err)
|
||||
} else if meta == nil {
|
||||
return nil, fuse.ENOENT
|
||||
}
|
||||
@@ -97,7 +97,7 @@ func (d *SnapshotsDir) Lookup(ctx context.Context, name string) (fs.Node, error)
|
||||
|
||||
meta, err := d.dirStruct.UpdatePrefix(ctx, d.prefix)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, unwrapCtxCanceled(err)
|
||||
} else if meta == nil {
|
||||
return nil, fuse.ENOENT
|
||||
}
|
||||
|
Reference in New Issue
Block a user