From: Christoph Hellwig Date: Wed, 2 Sep 2009 17:55:45 +0000 (+0000) Subject: repair: add missing locking in scanfunc_bmap X-Git-Tag: v3.0.5~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bad0fe5;p=thirdparty%2Fxfsprogs-dev.git repair: add missing locking in scanfunc_bmap Make sure to protect access to the block usage tracking btree with the ag_lock. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Alex Elder --- diff --git a/repair/scan.c b/repair/scan.c index 158fb4363..f2bf86307 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