From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fuse: don't bump attr_version for async direct read completion
Date: Fri, 17 Jul 2026 22:14:00 +0800 [thread overview]
Message-ID: <efd2adbd-b642-428c-aa7d-29c70af99e51@linux.alibaba.com> (raw)
In-Reply-To: <CAJfpegvqdRQDDd6io2an5mBU=3Lkp23aHDa-ETN3EWVotu29WQ@mail.gmail.com>
On 7/17/26 9:58 PM, Miklos Szeredi wrote:
> On Mon, 6 Jul 2026 at 10:29, Jingbo Xu <jefflexu@linux.alibaba.com> wrote:
>>
>> The attr_version counter should only be incremented when cached
>> attributes are actually modified (as documented in commit 1fb69e781729
>> ("fuse: fix race between getattr and write")). Async direct reads do not
>> modify any cached inode attributes (size, mtime, ctime), so bumping
>> attr_version in fuse_aio_complete() for reads is incorrect.
>>
>> This unconditional bump causes a livelock when auto_inval_data is
>> enabled together with writeback_cache: fuse_cache_read_iter() issues a
>> FUSE_GETATTR before every read, but by the time the response arrives,
>> an async DIO read completion has already incremented fi->attr_version
>> past the snapshot taken before the request. The GETATTR result is then
>> discarded (attr_version race), fi->i_time is never refreshed, and every
>> subsequent read triggers yet another GETATTR -- creating an infinite
>> loop of useless round-trips.
>>
>> Fix this by only bumping attr_version for write completions, consistent
>> with the synchronous DIO write path (fuse_write_update_attr) and the
>> cached write path.
>>
>> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
>
> Can you please add a Fixes: tag and possibly Cc: stable@... if appropriate?
Sure. Will send v2 soon.
--
Thanks,
Jingbo
prev parent reply other threads:[~2026-07-17 14:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 8:29 Jingbo Xu
2026-07-06 8:38 ` Horst Birthelmer
2026-07-17 13:58 ` Miklos Szeredi
2026-07-17 14:14 ` Jingbo Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efd2adbd-b642-428c-aa7d-29c70af99e51@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=fuse-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox