Skip to content

Commit

Permalink
xfs: fix I_DONTCACHE
Browse files Browse the repository at this point in the history
Yup, the VFS hoist broke it, and nobody noticed. Bulkstat workloads
make it clear that it doesn't work as it should.

Fixes: dae2f8e ("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]>
  • Loading branch information
Dave Chinner authored and Darrick J. Wong committed Aug 25, 2021
1 parent 72a048c commit f38a032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_icache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f38a032

Please sign in to comment.