Skip to content

Commit eb4b691

Browse files
kdrag0nMiklos Szeredi
authored andcommitted
fuse: fix leaked ENOSYS error on first statx call
FUSE attempts to detect server support for statx by trying it once and setting no_statx=1 if it fails with ENOSYS, but consider the following scenario: - Userspace (e.g. sh) calls stat() on a file * succeeds - Userspace (e.g. lsd) calls statx(BTIME) on the same file - request_mask = STATX_BASIC_STATS | STATX_BTIME - first pass: sync=true due to differing cache_mask - statx fails and returns ENOSYS - set no_statx and retry - retry sets mask = STATX_BASIC_STATS - now mask == cache_mask; sync=false (time_before: still valid) - so we take the "else if (stat)" path - "err" is still ENOSYS from the failed statx call Fix this by zeroing "err" before retrying the failed call. Fixes: d304553 ("fuse: implement statx") Cc: [email protected] # v6.6 Signed-off-by: Danny Lin <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 7cc9112 commit eb4b691

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/fuse/dir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,7 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
13211321
err = fuse_do_statx(inode, file, stat);
13221322
if (err == -ENOSYS) {
13231323
fc->no_statx = 1;
1324+
err = 0;
13241325
goto retry;
13251326
}
13261327
} else {

0 commit comments

Comments
 (0)