summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/scrub.c
diff options
context:
space:
mode:
authorDarrick J. Wong2018-05-09 19:02:00 +0200
committerDarrick J. Wong2018-05-16 02:57:05 +0200
commiteb41c93fef19ebcafbbe3c180ec41c21032b751e (patch)
tree0c98d5216d4f6ee7d893f71c5076d3b3bbe1c398 /fs/xfs/scrub/scrub.c
parentxfs: refactor dquot iteration (diff)
downloadkernel-qcow2-linux-eb41c93fef19ebcafbbe3c180ec41c21032b751e.tar.gz
kernel-qcow2-linux-eb41c93fef19ebcafbbe3c180ec41c21032b751e.tar.xz
kernel-qcow2-linux-eb41c93fef19ebcafbbe3c180ec41c21032b751e.zip
xfs: avoid ilock games in the quota scrubber
Refactor the quota scrubber to take the quotaofflock and grab the quota inode in the setup function so that we can treat quota in the same "scrub in the context of this inode" (i.e. sc->ip) manner as we treat any other inode. We do have to drop the quota inode's ILOCK_EXCL to use dqiterate, but since dquots have their own individual locks the ILOCK wasn't helping us anyway. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/scrub.c')
-rw-r--r--fs/xfs/scrub/scrub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 26c75967a072..67509d8b8b8e 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -42,6 +42,8 @@
#include "xfs_refcount_btree.h"
#include "xfs_rmap.h"
#include "xfs_rmap_btree.h"
+#include "xfs_quota.h"
+#include "xfs_qm.h"
#include "scrub/xfs_scrub.h"
#include "scrub/scrub.h"
#include "scrub/common.h"
@@ -166,6 +168,8 @@ xfs_scrub_teardown(
iput(VFS_I(sc->ip));
sc->ip = NULL;
}
+ if (sc->has_quotaofflock)
+ mutex_unlock(&sc->mp->m_quotainfo->qi_quotaofflock);
if (sc->buf) {
kmem_free(sc->buf);
sc->buf = NULL;