From: Barry Naujok Date: Thu, 12 Nov 2009 10:28:37 +0000 (+0100) Subject: repair: add missing locking in scanfunc_bmap X-Git-Tag: v3.1.0~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9161500e9813250b4bad3f6fdd940f38a80ac27b;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 --- diff --git a/repair/scan.c b/repair/scan.c index 7435cc8de..5f5743e63 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