Re: [PATCH 1/4] xfs: eager inode attr fork init needs attr feature awareness
From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-03-30 18:11:33
From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-03-30 18:11:33
On Tue, Mar 30, 2021 at 04:30:56PM +1100, Dave Chinner wrote:
From: Dave Chinner <redacted>
The pitfalls of regression testing on a machine without realising
that selinux was disabled. Only set the attr fork during inode
allocation if the attr feature bits are already set on the
superblock.
Fixes: e6a688c33238 ("xfs: initialise attr fork on inode create")
Signed-off-by: Dave Chinner <redacted>Looks reasonable to me, Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D
--- fs/xfs/xfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c09bb39baeea..3b516ab7f22b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c@@ -887,7 +887,7 @@ xfs_init_new_inode( * this saves us from needing to run a separate transaction to set the * fork offset in the immediate future. */ - if (init_xattrs) { + if (init_xattrs && xfs_sb_version_hasattr(&mp->m_sb)) { ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3; ip->i_afp = xfs_ifork_alloc(XFS_DINODE_FMT_EXTENTS, 0); }-- 2.31.0