]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: add missing locking in scanfunc_bmap
authorChristoph Hellwig <hch@infradead.org>
Wed, 2 Sep 2009 17:55:45 +0000 (17:55 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 23 Oct 2009 17:19:10 +0000 (12:19 -0500)
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>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
repair/scan.c

index 158fb436354d972006e19df9388adffccbbf8784..f2bf863073d1ef9ca514d1f115476f84afa037ae 100644 (file)
@@ -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