[PATCH] xfsprogs: duplicate extent btrees in xfs_repair need locking

Christoph Hellwig hch at infradead.org
Fri Mar 12 04:13:04 CST 2010


On Thu, Mar 11, 2010 at 08:15:30PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
> 
> The per-ag duplicate extent btrees can be search concurrently from multiple
> threads. This occurs when inode extent lists are being processed and inodes
> with extents in the same AG are checked concurrently. The btrees have an
> internal traversal cursor, so doing concurrent searches can result in the
> cursor being corrupted for both searches.
> 
> Add an external lock for each duplicate extent tree and use it for searches,
> inserts and deletes to ensure that we don't trash the state of any operation.
> 
> Signed-off-by: Dave Chinner <dchinner at redhat.com>

Note that all actual content modifications to the tree are done from
single threaded code, so strictly speaking we'd only need to lock in
search_dup_extent.  Anyway, the locking shouldn't add enough overhead
to worry about this, so:


Reviewed-by: Christoph Hellwig <hch at lst.de>




More information about the xfs mailing list