diff options
author | Yan <yanzheng@21cn.com> | 2008-07-24 12:18:16 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 974e35a82d022434efa50fe5f805ae14c542ba8c (patch) | |
tree | be21c7139c573ad57d69cd81344161a6b5e21cef /fs/btrfs/extent-tree.c | |
parent | 45467261edb590fd5a2d676d9686edb82762fb3f (diff) |
Btrfs: Properly release lock in pin_down_bytes
When buffer isn't uptodate, pin_down_bytes may leave the tree locked
after it returns.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index e6a3ba9dd107..cdfb4ff4b459 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1485,8 +1485,8 @@ static int pin_down_bytes(struct btrfs_root *root, u64 bytenr, u32 num_bytes, | |||
1485 | struct extent_buffer *buf; | 1485 | struct extent_buffer *buf; |
1486 | buf = btrfs_find_tree_block(root, bytenr, num_bytes); | 1486 | buf = btrfs_find_tree_block(root, bytenr, num_bytes); |
1487 | if (buf) { | 1487 | if (buf) { |
1488 | if (btrfs_try_tree_lock(buf) && | 1488 | if (btrfs_buffer_uptodate(buf, 0) && |
1489 | btrfs_buffer_uptodate(buf, 0)) { | 1489 | btrfs_try_tree_lock(buf)) { |
1490 | u64 transid = | 1490 | u64 transid = |
1491 | root->fs_info->running_transaction->transid; | 1491 | root->fs_info->running_transaction->transid; |
1492 | u64 header_transid = | 1492 | u64 header_transid = |