aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-05-31 15:54:30 -0400
committerChris Mason <chris.mason@oracle.com>2012-06-14 21:29:14 -0400
commitee670f0af35871edb492db5ba406cef36d1b7c21 (patch)
tree9f4c709d8df44bcdccd73a8e7c189fe789ac751a /fs/btrfs
parent7b8b92af58db347de64a237861fcf13374b34a9c (diff)
Btrfs: fix btrfs_destroy_marked_extents
So we're forcing the eb's to have their ref count set to 1 so invalidatepage works but this breaks lots of things, for example root nodes, and is just plain wrong, we don't need to just evict all of this stuff. Also drop the invalidatepage altogether and add a page_cache_release(). With this patch we no longer hang when trying to access the root nodes after an aborted transaction and we no longer leak memory. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/disk-io.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 19b4db70dcb1..5a3bf323e2bd 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3524,11 +3524,9 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root,
3524 &(&BTRFS_I(page->mapping->host)->io_tree)->buffer, 3524 &(&BTRFS_I(page->mapping->host)->io_tree)->buffer,
3525 offset >> PAGE_CACHE_SHIFT); 3525 offset >> PAGE_CACHE_SHIFT);
3526 spin_unlock(&dirty_pages->buffer_lock); 3526 spin_unlock(&dirty_pages->buffer_lock);
3527 if (eb) { 3527 if (eb)
3528 ret = test_and_clear_bit(EXTENT_BUFFER_DIRTY, 3528 ret = test_and_clear_bit(EXTENT_BUFFER_DIRTY,
3529 &eb->bflags); 3529 &eb->bflags);
3530 atomic_set(&eb->refs, 1);
3531 }
3532 if (PageWriteback(page)) 3530 if (PageWriteback(page))
3533 end_page_writeback(page); 3531 end_page_writeback(page);
3534 3532
@@ -3542,8 +3540,8 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root,
3542 spin_unlock_irq(&page->mapping->tree_lock); 3540 spin_unlock_irq(&page->mapping->tree_lock);
3543 } 3541 }
3544 3542
3545 page->mapping->a_ops->invalidatepage(page, 0);
3546 unlock_page(page); 3543 unlock_page(page);
3544 page_cache_release(page);
3547 } 3545 }
3548 } 3546 }
3549 3547