diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-02-10 12:35:00 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-14 13:03:52 -0500 |
commit | eb14ab8ed24a0405fd056068b28c33a1cd846024 (patch) | |
tree | 1451cad453a3ff66bc5369dc83daf7e3a50c4897 /fs/btrfs/disk-io.c | |
parent | 3a90983dbdcb2f4f48c0d771d8e5b4d88f27fae6 (diff) | |
download | kernel_samsung_smdk4412-eb14ab8ed24a0405fd056068b28c33a1cd846024.zip kernel_samsung_smdk4412-eb14ab8ed24a0405fd056068b28c33a1cd846024.tar.gz kernel_samsung_smdk4412-eb14ab8ed24a0405fd056068b28c33a1cd846024.tar.bz2 |
Btrfs: fix page->private races
There is a race where btrfs_releasepage can drop the
page->private contents just as alloc_extent_buffer is setting
up pages for metadata. Because of how the Btrfs page flags work,
this results in us skipping the crc on the page during IO.
This patch sovles the race by waiting until after the extent buffer
is inserted into the radix tree before it sets page private.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b36eeef..3e1ea3e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -359,10 +359,14 @@ static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) tree = &BTRFS_I(page->mapping->host)->io_tree; - if (page->private == EXTENT_PAGE_PRIVATE) + if (page->private == EXTENT_PAGE_PRIVATE) { + WARN_ON(1); goto out; - if (!page->private) + } + if (!page->private) { + WARN_ON(1); goto out; + } len = page->private >> 2; WARN_ON(len == 0); |