mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
3a90983dbd
commit
eb14ab8ed2
2 changed files with 41 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue