summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_icache.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-03-29 21:11:39 +0300
committerDarrick J. Wong <djwong@kernel.org>2021-04-08 00:37:03 +0300
commit7e2a8af528396d275962b33af9e5350da10c01f3 (patch)
tree6af18476fcf1d37956b69cd7b6e875d5311b33fe /fs/xfs/xfs_icache.c
parent9b3beb028ff5bed99473021d1a7de8747665ac32 (diff)
downloadlinux-7e2a8af528396d275962b33af9e5350da10c01f3.tar.xz
xfs: don't clear the "dinode core" in xfs_inode_alloc
The xfs_icdinode structure just contains a random mix of inode field, which are all read from the on-disk inode and mostly not looked at before reading the inode or initializing a new inode cluster. The only exceptions are the forkoff and blocks field, which are used in sanity checks for freshly allocated inodes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r--fs/xfs/xfs_icache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 54d483ea34c8..fae6392f7c56 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -63,8 +63,9 @@ xfs_inode_alloc(
memset(&ip->i_df, 0, sizeof(ip->i_df));
ip->i_flags = 0;
ip->i_delayed_blks = 0;
- memset(&ip->i_d, 0, sizeof(ip->i_d));
ip->i_d.di_flags2 = mp->m_ino_geo.new_diflags2;
+ ip->i_d.di_nblocks = 0;
+ ip->i_d.di_forkoff = 0;
ip->i_sick = 0;
ip->i_checked = 0;
INIT_WORK(&ip->i_ioend_work, xfs_end_io);