xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsprogs: duplicate extent btrees in xfs_repair need locking
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 12 Mar 2010 05:13:04 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1268298930-20809-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1268298930-20809-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
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>

<Prev in Thread] Current Thread [Next in Thread>