Yan Zheng
2008-Jul-10 19:20 UTC
[Btrfs-devel][PATCH] Properly release lock in pin_down_bytes
Hello, When buffer isn''t uptodate, pin_down_bytes may leave the tree locked after it returns. Regards YZ --- diff -r 3f0eee804974 extent-tree.c --- a/extent-tree.c Thu Jun 26 10:34:20 2008 -0400 +++ b/extent-tree.c Fri Jul 11 03:20:00 2008 +0800 @@ -1441,8 +1441,8 @@ static int pin_down_bytes(struct btrfs_r struct extent_buffer *buf; buf = btrfs_find_tree_block(root, bytenr, num_bytes); if (buf) { - if (!btrfs_try_tree_lock(buf) && - btrfs_buffer_uptodate(buf, 0)) { + if (btrfs_buffer_uptodate(buf, 0) && + !btrfs_try_tree_lock(buf)) { u64 transid root->fs_info->running_transaction->transid; u64 header_transid -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html