From bad0fe5d541323ff47167638ae4a577d9999a67c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 2 Sep 2009 17:55:45 +0000 Subject: [PATCH] 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 --- repair/scan.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.5