Commit 61b6bdb3 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: adjust xfs_bmap_add_attrfork for metadir



Online repair might use the xfs_bmap_add_attrfork to repair a file in
the metadata directory tree if (say) the metadata file lacks the correct
parent pointers.  In that case, it is not correct to check that the file
is dqattached -- metadata files must be not have /any/ dquot attached at
all.  Adjust the assertions appropriately.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent cc0cf84a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1004,6 +1004,9 @@ xfs_attr_add_fork(
	unsigned int		blks;		/* space reservation */
	int			error;		/* error return value */

	if (xfs_is_metadir_inode(ip))
		ASSERT(XFS_IS_DQDETACHED(ip));
	else
		ASSERT(!XFS_NOT_DQATTACHED(mp, ip));

	blks = XFS_ADDAFORK_SPACE_RES(mp);
+4 −1
Original line number Diff line number Diff line
@@ -1042,6 +1042,9 @@ xfs_bmap_add_attrfork(
	int			error;		/* error return value */

	xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
	if (xfs_is_metadir_inode(ip))
		ASSERT(XFS_IS_DQDETACHED(ip));
	else
		ASSERT(!XFS_NOT_DQATTACHED(mp, ip));
	ASSERT(!xfs_inode_has_attr_fork(ip));