[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegvhym5UUBpsn2CMZ_duv3Ook6JDHF=h5A7Hz4dY1jU9PQ@mail.gmail.com>
Date: Mon, 15 Apr 2024 09:46:23 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Danny Lin <danny@...stack.dev>
Cc: stable@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fuse: fix leaked ENOSYS error on first statx call
On Sun, 14 Apr 2024 at 02:34, Danny Lin <danny@...stack.dev> wrote:
>
> 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.
Thanks, applied.
Miklos
Powered by blists - more mailing lists