diff options
author | Chris Mason <chris.mason@oracle.com> | 2012-05-06 07:23:47 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-05-06 07:23:47 -0400 |
commit | b9fab919b748c7b39c19ff236ed6c5682c266dde (patch) | |
tree | 49e5a6f8041a7f0a9be0c1a39cd9088e3faa1df2 /fs/btrfs/tree-log.c | |
parent | ea9947b4395fa34666086b2fa6f686e94903e047 (diff) | |
download | linux-b9fab919b748c7b39c19ff236ed6c5682c266dde.tar.gz linux-b9fab919b748c7b39c19ff236ed6c5682c266dde.tar.bz2 linux-b9fab919b748c7b39c19ff236ed6c5682c266dde.zip |
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>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d017283ae6f5..eb1ae908582c 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -279,7 +279,7 @@ static int process_one_buffer(struct btrfs_root *log, log->fs_info->extent_root, eb->start, eb->len); - if (btrfs_buffer_uptodate(eb, gen)) { + if (btrfs_buffer_uptodate(eb, gen, 0)) { if (wc->write) btrfs_write_tree_block(eb); if (wc->wait) |