]> Git Repo - linux.git/commitdiff
xfs: fix I_DONTCACHE
authorDave Chinner <[email protected]>
Wed, 25 Aug 2021 02:13:04 +0000 (19:13 -0700)
committerDarrick J. Wong <[email protected]>
Wed, 25 Aug 2021 02:13:04 +0000 (19:13 -0700)
Yup, the VFS hoist broke it, and nobody noticed. Bulkstat workloads
make it clear that it doesn't work as it should.

Fixes: dae2f8ed7992 ("fs: Lift XFS_IDONTCACHE to the VFS layer")
Signed-off-by: Dave Chinner <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
fs/xfs/xfs_icache.c
fs/xfs/xfs_iops.c

index a3fe4c5307d33114af01f23a620de0e1eb0de007..f2210d927481b466678ad1b0905980b540d1d7d8 100644 (file)
@@ -84,8 +84,9 @@ xfs_inode_alloc(
                return NULL;
        }
 
-       /* VFS doesn't initialise i_mode! */
+       /* VFS doesn't initialise i_mode or i_state! */
        VFS_I(ip)->i_mode = 0;
+       VFS_I(ip)->i_state = 0;
 
        XFS_STATS_INC(mp, vn_active);
        ASSERT(atomic_read(&ip->i_pincount) == 0);
index 0ff0cca94092002ed47720c3199a0ed9b6bd0f6d..a607d6aca5c4d38e722e35e6cf97e12675ed5bd0 100644 (file)
@@ -1344,7 +1344,7 @@ xfs_setup_inode(
        gfp_t                   gfp_mask;
 
        inode->i_ino = ip->i_ino;
-       inode->i_state = I_NEW;
+       inode->i_state |= I_NEW;
 
        inode_sb_list_add(inode);
        /* make the inode look hashed for the writeback code */
This page took 0.063423 seconds and 4 git commands to generate.