aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Naujok <bnaujok@sgi.com>2009-09-08 11:17:07 -0300
committerhch@lst.de <Christoph Hellwig>2009-09-08 11:17:07 -0300
commit5330b0de1c552f57b3191af20c09cf04540ac2de (patch)
treeefee6779265ed84ff2120ff8d0d7fd7ae02b2243
parent7fa01d6816952ce7d6fa5544a44c781b3dbbfee9 (diff)
downloadxfsprogs-dev-repair-speedup-20090908.tar.gz
repair: add missing locking in scanfunc_bmaprepair-speedup-20090908
Make sure to protect access to the block usage tracking btree with the ag_lock. Signed-off-by: Barry Naujok <bnaujok@sgi.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--repair/scan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/repair/scan.c b/repair/scan.c
index 8255b0b28d..f86d954ce5 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -235,6 +235,7 @@ _("bad back (left) sibling pointer (saw %llu should be NULL (0))\n"
agno = XFS_FSB_TO_AGNO(mp, bno);
agbno = XFS_FSB_TO_AGBNO(mp, bno);
+ pthread_mutex_lock(&ag_locks[agno]);
state = get_bmap(agno, agbno);
switch (state) {
case XR_E_UNKNOWN:
@@ -280,6 +281,7 @@ _("bad back (left) sibling pointer (saw %llu should be NULL (0))\n"
state, ino, (__uint64_t) bno);
break;
}
+ pthread_mutex_unlock(&ag_locks[agno]);
} else {
/*
* attribute fork for realtime files is in the regular