]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_repair: take the ag_lock before recording rmap for a bmbt record
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 15 Sep 2017 13:33:45 +0000 (08:33 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 15 Sep 2017 13:33:45 +0000 (08:33 -0500)
commit5d52e7a5799c9843aef325e926a794638c48ad43
tree21feec0e6205954fac7d0a7dace3899ae9047581
parent9a106b5fbb88342f0ee02891d1bbb0e3c5a93d03
xfs_repair: take the ag_lock before recording rmap for a bmbt record

When the (threaded) inode scanner iterates the blocks of a bmbt tree and
wants to record the bmbt blocks in the in-core rmap database, we have to
take the ag_lock for the AG that the bmbt block is in, or else we can
accidentally corrupt the rmap slab by calling slab_add from two threads.

Reported-by: matorola@gmail.com
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/scan.c