From: Darrick J. Wong Date: Fri, 21 Mar 2025 16:31:31 +0000 (-0700) Subject: xfs_repair: don't recreate /quota metadir if there are no quota inodes X-Git-Tag: v6.14.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28db545be050f4571e9bf642133c1b969091f82c;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: don't recreate /quota metadir if there are no quota inodes If repair does not discover even a single quota file, then don't have it try to create a /quota metadir to hold them. This avoids pointless repair failures on quota-less filesystems that are nearly full. Found via generic/558 on a zoned=1 filesystem. Cc: linux-xfs@vger.kernel.org # v6.13.0 Fixes: b790ab2a303d58 ("xfs_repair: support quota inodes in the metadata directory") Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn Reviewed-by: Christoph Hellwig --- diff --git a/repair/phase6.c b/repair/phase6.c index 4064a84b..2d526dda 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -3538,6 +3538,11 @@ reset_quota_metadir_inodes( struct xfs_inode *dp = NULL; int error; + if (!has_quota_inode(XFS_DQTYPE_USER) && + !has_quota_inode(XFS_DQTYPE_GROUP) && + !has_quota_inode(XFS_DQTYPE_PROJ)) + return; + error = -libxfs_dqinode_mkdir_parent(mp, &dp); if (error) do_error(_("failed to create quota metadir (%d)\n"),