diff options
| author | Jingbo Xu <jefflexu@linux.alibaba.com> | 2026-07-17 22:29:32 +0800 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2026-09-02 09:36:08 +0200 |
| commit | fc60668db85584da911e5d0a65c8698628f98bba (patch) | |
| tree | 99867d6d38bb263eac734b164fd3d5915482ecde /tools/lib/python/kdoc | |
| parent | c1f6e67c4fe74af5e89282222c5b95dc322a7d58 (diff) | |
fuse: don't bump attr_version for async direct read completion
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.
Fixes: 01e9d11a3e79 ("fuse: add support of async IO")
Reviewed-by: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
