summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zheng.yan@oracle.com>2010-05-26 17:20:30 +0200
committerChris Mason <chris.mason@oracle.com>2010-05-27 03:35:33 +0200
commit5bdd3536cbbe2ecd94ecc14410c6b1b31da16381 (patch)
tree7fd9cd2cb497f6150a5dfde4528ba6ba64144e40
parentBtrfs: fix preallocation and nodatacow checks in O_DIRECT (diff)
downloadlinux-5bdd3536cbbe2ecd94ecc14410c6b1b31da16381.tar.xz
linux-5bdd3536cbbe2ecd94ecc14410c6b1b31da16381.zip
Btrfs: Fix block generation verification race
After the path is released, the generation number got from block pointer is no long valid. The race may cause disk corruption, because verify_parent_transid() calls clear_extent_buffer_uptodate() when generation numbers mismatch. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/ctree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index acd532af8e55..0d1d966b0fe4 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1604,7 +1604,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
btrfs_release_path(NULL, p);
ret = -EAGAIN;
- tmp = read_tree_block(root, blocknr, blocksize, gen);
+ tmp = read_tree_block(root, blocknr, blocksize, 0);
if (tmp) {
/*
* If the read above didn't mark this buffer up to date,