From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, jack@suse.cz
Subject: Re: Why page w/o buffers can not be released?
Date: Wed, 5 Sep 2012 14:28:09 +0200 [thread overview]
Message-ID: <20120905122809.GB18051@quack.suse.cz> (raw)
In-Reply-To: <871uig906i.fsf@openvz.org>
On Wed 05-09-12 15:30:29, Dmitry Monakhov wrote:
>
> ext3, ext4 and ocfs2 do not allow to release page w/o buffers.
> Can some one please explain me why?
>
> ext4_releasepage(struct page *page, gfp_t wait)
> {
> if (!page_has_buffers(page))
> return 0;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^( zero means fail to release)
> if (journal)
> return jbd2_journal_try_to_free_buffers(journal, page, wait);
> else
> return try_to_free_buffers(page);
> }
>
> This is looks very strange because if page has not buffers then
> it has no fs-specific data associated with it. Am I right?
> IMHO code should looks like follows:
> xxx_releasepage() {
>
> if(PageWriteback(page))
> return 0;
> if (!page_has_buffers(page))
> return 1;
>
> return do_fs_specific_stuff()
> }
Yeah, I agree. Although this is mostly a harmless thing because all call
sites test for page_has_private(page) before calling try_to_release_page(page)
so !page_has_buffers(page) is impossible. But a cleanup (remove the test) would
be nice.
Also PageWriteback() is checked in try_to_release_page() so filesystems
don't have to care...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
parent reply other threads:[~2012-09-05 12:28 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <871uig906i.fsf@openvz.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120905122809.GB18051@quack.suse.cz \
--to=jack@suse.cz \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).