aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-11-10 07:31:30 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-10 07:31:30 -0500
commitf2b1c41cf94d7f839fe9ede5f3ead92698a93fb3 (patch)
treedbde0effe5d2e147dd74af96b29ece862b94960d /fs
parent5b7c3fcc46b5deb8a368d5319cf87c78c2df65fe (diff)
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 <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index ad75a9cc3604..69ea09659d47 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,
1205 */ 1205 */
1206 if (pages[i] != locked_page) { 1206 if (pages[i] != locked_page) {
1207 lock_page(pages[i]); 1207 lock_page(pages[i]);
1208 if (pages[i]->mapping != inode->i_mapping) { 1208 if (!PageDirty(pages[i]) ||
1209 pages[i]->mapping != inode->i_mapping) {
1209 ret = -EAGAIN; 1210 ret = -EAGAIN;
1210 unlock_page(pages[i]); 1211 unlock_page(pages[i]);
1211 page_cache_release(pages[i]); 1212 page_cache_release(pages[i]);