[PATCH 4/5] 9p: Always update remote_i_size in stat2inode
David Howells
dhowells at redhat.com
Thu Jan 4 01:59:28 AEDT 2024
Always update remote_i_size in v9fs_stat2inode*() if the size is available,
even if we are asked not to update i_isize
Suggested-by: Dominique Martinet <asmadeus at codewreck.org>
Link: https://lore.kernel.org/r/ZZVctju5TEjS218p@codewreck.org/
Signed-off-by: David Howells <dhowells at redhat.com>
cc: Eric Van Hensbergen <ericvh at kernel.org>
cc: Latchesar Ionkov <lucho at ionkov.net>
cc: Christian Schoenebeck <linux_oss at crudebyte.com>
cc: v9fs at lists.linux.dev
cc: linux-cachefs at redhat.com
cc: linux-fsdevel at vger.kernel.org
---
fs/9p/vfs_inode_dotl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 3505227e1704..aa3a77bb5e86 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -684,10 +684,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode,
mode |= inode->i_mode & ~S_IALLUGO;
inode->i_mode = mode;
}
- if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) &&
- stat->st_result_mask & P9_STATS_SIZE) {
+ if (stat->st_result_mask & P9_STATS_SIZE) {
v9inode->netfs.remote_i_size = stat->st_size;
- v9fs_i_size_write(inode, stat->st_size);
+ if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE))
+ v9fs_i_size_write(inode, stat->st_size);
}
if (stat->st_result_mask & P9_STATS_BLOCKS)
inode->i_blocks = stat->st_blocks;
More information about the Linux-erofs
mailing list