* [PATCH] ext4: Fix WARN_ON from ext4_releasepage()
@ 2013-03-07 14:52 Jan Kara
2013-03-08 12:45 ` Zheng Liu
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2013-03-07 14:52 UTC (permalink / raw)
To: Ted Tso; +Cc: Zheng Liu, linux-ext4, Jan Kara
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>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/inode.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9c4f4b1..34cc72d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2912,8 +2912,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);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: Fix WARN_ON from ext4_releasepage()
2013-03-07 14:52 [PATCH] ext4: Fix WARN_ON from ext4_releasepage() Jan Kara
@ 2013-03-08 12:45 ` Zheng Liu
2013-03-11 2:20 ` Theodore Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Zheng Liu @ 2013-03-08 12:45 UTC (permalink / raw)
To: Jan Kara; +Cc: Ted Tso, linux-ext4
On Thu, Mar 07, 2013 at 03:52:49PM +0100, Jan Kara wrote:
> 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>
> Signed-off-by: Jan Kara <jack@suse.cz>
Thanks for fixing it. I can confirm that the warning disappears.
Tested-by: Zheng Liu <wenqing.lz@taobao.com>
Regards,
- Zheng
> ---
> fs/ext4/inode.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 9c4f4b1..34cc72d 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -2912,8 +2912,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);
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-11 2:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 14:52 [PATCH] ext4: Fix WARN_ON from ext4_releasepage() Jan Kara
2013-03-08 12:45 ` Zheng Liu
2013-03-11 2:20 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).