diff mbox series

[RFC,6/6] fs/9p: non-.L: Refresh stale inodes on reuse

Message ID e9c49c3dd0359196fff8bd6321b431e9a890fe7a.1743971855.git.m@maowtm.org (mailing list archive)
State New
Headers show
Series fs/9p: Reuse inode based on path (in addition to qid) | expand

Commit Message

Tingmao Wang April 6, 2025, 8:43 p.m. UTC
This replicates the previous .L commit for non-.L

Signed-off-by: Tingmao Wang <m@maowtm.org>
---
 fs/9p/vfs_inode.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 1137a5960ac2..3f087b0bf1bf 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -498,8 +498,14 @@  static struct inode *v9fs_qid_iget(struct super_block *sb, struct p9_qid *qid,
 
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
-	if (!(inode->i_state & I_NEW))
+	if (!(inode->i_state & I_NEW)) {
+		/* See explanation in v9fs_qid_iget_dotl */
+		if (new) {
+			v9fs_stat2inode(st, inode, sb,
+				(v9ses->cache & CACHE_LOOSE) ?  V9FS_STAT2INODE_KEEP_ISIZE : 0);
+		}
 		return inode;
+	}
 	/*
 	 * initialize the inode with the stat info
 	 * FIXME!! we may need support for stale inodes