aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-03-10 22:19:00 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-03-10 22:19:00 -0400
commite1c36595bedc2e1b4112f01256cb30f4d9f9ae46 (patch)
treef4330bbfa5bc21817d2f58cccb6c234431d73b1d
parent3a2256702e47f68f921dfad41b1764d05c572329 (diff)
ext4: fix WARN_ON from ext4_releasepage()
ext4_releasepage() warns when it is passed a page with PageChecked set. However this can correctly happen when invalidate_inode_pages2_range() invalidates pages - and we should fail the release in that case. Since the page was dirty anyway, it won't be discarded and no harm has happened but it's good to be safe. Also remove bogus page_has_buffers() check - we are guaranteed page has buffers in this function. Reported-by: Zheng Liu <gnehzuil.liu@gmail.com> Tested-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext4/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4f1d54a88d8c..117a9e7aa4a0 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3018,8 +3018,8 @@ static int ext4_releasepage(struct page *page, gfp_t wait)
3018 3018
3019 trace_ext4_releasepage(page); 3019 trace_ext4_releasepage(page);
3020 3020
3021 WARN_ON(PageChecked(page)); 3021 /* Page has dirty journalled data -> cannot release */
3022 if (!page_has_buffers(page)) 3022 if (PageChecked(page))
3023 return 0; 3023 return 0;
3024 if (journal) 3024 if (journal)
3025 return jbd2_journal_try_to_free_buffers(journal, page, wait); 3025 return jbd2_journal_try_to_free_buffers(journal, page, wait);