fs/9p: remove erroneous nlink init from legacy stat2inode
authorEric Van Hensbergen <ericvh@kernel.org>
Tue, 9 Apr 2024 23:53:00 +0000 (23:53 +0000)
committerEric Van Hensbergen <ericvh@kernel.org>
Tue, 9 Apr 2024 23:53:00 +0000 (23:53 +0000)
In 9p2000 legacy mode, stat2inode initializes nlink to 1,
which is redundant with what alloc_inode should have already set.
9p2000.u overrides this with extensions if present in the stat
structure, and 9p2000.L incorporates nlink into its stat structure.

At the very least this probably messes with directory nlink
accounting in legacy mode.

Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
fs/9p/vfs_inode.c

index c5b4d3631c47e0d2be4793f64a6224d3555c9e97..47bd77199e20c83a3c7554d5dc592697080b7885 100644 (file)
@@ -1064,8 +1064,6 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
        struct v9fs_session_info *v9ses = sb->s_fs_info;
        struct v9fs_inode *v9inode = V9FS_I(inode);
 
-       set_nlink(inode, 1);
-
        inode_set_atime(inode, stat->atime, 0);
        inode_set_mtime(inode, stat->mtime, 0);
        inode_set_ctime(inode, stat->mtime, 0);