Re: [PATCH v2] 9p: fix i_size update race in getattr with writeback caching
From: David Howells
Date: Wed Feb 18 2026 - 08:41:48 EST
David Howells <dhowells@xxxxxxxxxx> wrote:
> A better way is probably, in v9fs_stat2inode() and v9fs_stat2inode_dotl(), if
> the inode isn't new, compare the values for stat->mtime to inode->i_mtime and
> stat->length to v9inode->netfs.remote_i_size and if they differ mark the inode
> as being remotely modified, invalidate the pagecache and reset inode->i_size.
>
> If stat->mtime == inode->i_mtime and stat->length ==
> v9inode->netfs.remote_i_size, then don't alter inode->i_size.
Also, you'd need to update remote_i_size upon successful completion of a write
RPC call to increase it up to the end of the write.
David