Skip to content

Conversation

@micromaomao
Copy link
Owner

@micromaomao micromaomao commented Oct 28, 2025

No description provided.

This reverts commit 43c36a5.

Patch was previously reverted due to overlooking cache=mmap mode.  When
cache=mmap (i.e. just CACHE_WRITEBACK), us refreshing the metadata lead to
overriding i_size even when there was cached data to be written,
effectively losing that data.

This can be fixed using V9FS_STAT2INODE_KEEP_ISIZE appropriately.  A case
which already does this is when creating a link on a cache=loose
filesystem fails on the remote side: v9fs_vfs_link() calls
v9fs_refresh_inode() with this flag.

Another problematic case is on a cache=6 (CACHE_META+CACHE_WRITEBACK) fs,
in which we will refresh the dentry with new metadata in
__v9fs_lookup_revalidate(), but does not pass V9FS_STAT2INODE_KEEP_ISIZE
flag to v9fs_stat2inode().  This also fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants