提交 974e35a8 编写于 作者: Y Yan 提交者: Chris Mason

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: NChris Mason <chris.mason@oracle.com>
上级 45467261
...@@ -1485,8 +1485,8 @@ static int pin_down_bytes(struct btrfs_root *root, u64 bytenr, u32 num_bytes, ...@@ -1485,8 +1485,8 @@ static int pin_down_bytes(struct btrfs_root *root, u64 bytenr, u32 num_bytes,
struct extent_buffer *buf; struct extent_buffer *buf;
buf = btrfs_find_tree_block(root, bytenr, num_bytes); buf = btrfs_find_tree_block(root, bytenr, num_bytes);
if (buf) { if (buf) {
if (btrfs_try_tree_lock(buf) && if (btrfs_buffer_uptodate(buf, 0) &&
btrfs_buffer_uptodate(buf, 0)) { btrfs_try_tree_lock(buf)) {
u64 transid = u64 transid =
root->fs_info->running_transaction->transid; root->fs_info->running_transaction->transid;
u64 header_transid = u64 header_transid =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册