On Thu, Mar 11, 2010 at 08:15:30PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
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@xxxxxx>
|