Skip to content

Commit

Permalink
ext4: fix WARN_ON from ext4_releasepage()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara authored and Theodore Ts'o committed Mar 11, 2013
1 parent 3a22567 commit e1c3659
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3018,8 +3018,8 @@ static int ext4_releasepage(struct page *page, gfp_t wait)

trace_ext4_releasepage(page);

WARN_ON(PageChecked(page));
if (!page_has_buffers(page))
/* Page has dirty journalled data -> cannot release */
if (PageChecked(page))
return 0;
if (journal)
return jbd2_journal_try_to_free_buffers(journal, page, wait);
Expand Down

0 comments on commit e1c3659

Please sign in to comment.