From: Barry Naujok Date: Tue, 8 Sep 2009 14:17:07 +0000 (-0300) Subject: repair: add missing locking in scanfunc_bmap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5330b0de1c552f57b3191af20c09cf04540ac2de;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 --- diff --git a/repair/scan.c b/repair/scan.c index 8255b0b28..f86d954ce 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