summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-22 19:19:26 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-29 07:27:22 -0800
commitbeaae8cd588ec7b4e58f4bc32f603be15fb11766 (patch)
treeec1741a6a8e6828c59849849b54ee0d29ee4d30e /fs/xfs
parent09ac862397041fc484cd7294b15d41073aa78864 (diff)
downloadop-kernel-dev-beaae8cd588ec7b4e58f4bc32f603be15fb11766.zip
op-kernel-dev-beaae8cd588ec7b4e58f4bc32f603be15fb11766.tar.gz
xfs: always zero di_flags2 when we free the inode
Always zero the di_flags2 field when we free the inode so that we never end up with an on-disk record for an unallocated inode that also has the reflink iflag set. This is in keeping with the general principle that only files can have the reflink iflag set, even though we'll zero out di_flags2 if we ever reallocate the inode. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c66effc..4ea6476 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2449,6 +2449,7 @@ xfs_ifree(
VFS_I(ip)->i_mode = 0; /* mark incore inode as free */
ip->i_d.di_flags = 0;
+ ip->i_d.di_flags2 = 0;
ip->i_d.di_dmevmask = 0;
ip->i_d.di_forkoff = 0; /* mark the attr fork not in use */
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
OpenPOWER on IntegriCloud