Btrfs: avoid sleeping in verify_parent_transid while atomic
verify_parent_transid needs to lock the extent range to make sure no IO is underway, and so it can safely clear the uptodate bits if our checks fail. But, a few callers are using it with spinlocks held. Most of the time, the generation numbers are going to match, and we don't want to switch to a blocking lock just for the error case. This adds an atomic flag to verify_parent_transid, and changes it to return EAGAIN if it needs to block to properly verifiy things. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
@@ -6568,7 +6568,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if (!btrfs_buffer_uptodate(next, generation)) {
|
||||
if (!btrfs_buffer_uptodate(next, generation, 0)) {
|
||||
btrfs_tree_unlock(next);
|
||||
free_extent_buffer(next);
|
||||
next = NULL;
|
||||
|
Reference in New Issue
Block a user