From: Chris Mason Date: Mon, 10 Nov 2008 12:31:30 +0000 (-0500) Subject: Btrfs: Make sure pages are dirty before doing delalloc for them X-Git-Tag: v2.6.29-rc1~27^2~9^2~55^2~32 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f2b1c41cf94d7f839fe9ede5f3ead92698a93fb3;p=linux-2.6-omap-h63xx.git Btrfs: Make sure pages are dirty before doing delalloc for them This adds a PageDirty check to the writeback path that locks pages for delalloc. If a page wasn't dirty at this point, it is in the process of being truncated away. Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index ad75a9cc360..69ea09659d4 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1205,7 +1205,8 @@ static noinline int lock_delalloc_pages(struct inode *inode, */ if (pages[i] != locked_page) { lock_page(pages[i]); - if (pages[i]->mapping != inode->i_mapping) { + if (!PageDirty(pages[i]) || + pages[i]->mapping != inode->i_mapping) { ret = -EAGAIN; unlock_page(pages[i]); page_cache_release(pages[i]);