Skip to content

Commit a679a61

Browse files
author
Miklos Szeredi
committed
fuse: fix fileattr op failure
The fileattr API conversion broke lsattr on ntfs3g. Previously the ioctl(... FS_IOC_GETFLAGS) returned an EINVAL error, but after the conversion the error returned by the fuse filesystem was not propagated back to the ioctl() system call, resulting in success being returned with bogus values. Fix by checking for outarg.result in fuse_priv_ioctl(), just as generic ioctl code does. Reported-by: Jean-Pierre André <[email protected]> Fixes: 72227ea ("fuse: convert to fileattr") Cc: <[email protected]> # v5.13 Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 754e0b0 commit a679a61

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fs/fuse/ioctl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,12 @@ static int fuse_priv_ioctl(struct inode *inode, struct fuse_file *ff,
394394
args.out_args[1].value = ptr;
395395

396396
err = fuse_simple_request(fm, &args);
397-
if (!err && outarg.flags & FUSE_IOCTL_RETRY)
398-
err = -EIO;
399-
397+
if (!err) {
398+
if (outarg.result < 0)
399+
err = outarg.result;
400+
else if (outarg.flags & FUSE_IOCTL_RETRY)
401+
err = -EIO;
402+
}
400403
return err;
401404
}
402405

0 commit comments

Comments
 (0)