From: Jan Kara <jack@suse.cz>
To: Nick Piggin <npiggin@suse.de>
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
viro@zeniv.linux.org.uk, linux-mm@kvack.org
Subject: Re: [patch 1/3] fs: buffer_head writepage no invalidate
Date: Fri, 10 Jul 2009 13:08:15 +0200 [thread overview]
Message-ID: <20090710110815.GI17524@duck.suse.cz> (raw)
In-Reply-To: <20090710093325.GG14666@wotan.suse.de>
On Fri 10-07-09 11:33:25, Nick Piggin wrote:
> After the previous patchset, this is my progress on the page_mkwrite
> thing... These patches are RFC only and have some bugs.
> --
> invalidate should not be required in the writeout path. The truncate
> sequence will first reduce i_size, then clean and discard any existing
> pagecache (and no new dirty pagecache can be added because i_size was
> reduced and i_mutex is being held), then filesystem data structures
> are updated.
>
> Filesystem needs to be able to handle writeout at any point before
> the last step, and once the 2nd step completes, there should be no
> unfreeable dirty buffers anyway (truncate performs the do_invalidatepage).
>
> Having filesystem changes depend on reading i_size without holding
> i_mutex is confusing at least. There is still a case in writepage
> paths in buffer.c uses i_size (testing which block to write out), but
> this is a small improvement.
This looks good.
Acked-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/buffer.c | 20 ++------------------
> 1 file changed, 2 insertions(+), 18 deletions(-)
>
> Index: linux-2.6/fs/buffer.c
> ===================================================================
> --- linux-2.6.orig/fs/buffer.c
> +++ linux-2.6/fs/buffer.c
> @@ -2663,18 +2663,8 @@ int nobh_writepage(struct page *page, ge
> /* Is the page fully outside i_size? (truncate in progress) */
> offset = i_size & (PAGE_CACHE_SIZE-1);
> if (page->index >= end_index+1 || !offset) {
> - /*
> - * The page may have dirty, unmapped buffers. For example,
> - * they may have been added in ext3_writepage(). Make them
> - * freeable here, so the page does not leak.
> - */
> -#if 0
> - /* Not really sure about this - do we need this ? */
> - if (page->mapping->a_ops->invalidatepage)
> - page->mapping->a_ops->invalidatepage(page, offset);
> -#endif
> unlock_page(page);
> - return 0; /* don't care */
> + return 0;
> }
>
> /*
> @@ -2867,14 +2857,8 @@ int block_write_full_page_endio(struct p
> /* Is the page fully outside i_size? (truncate in progress) */
> offset = i_size & (PAGE_CACHE_SIZE-1);
> if (page->index >= end_index+1 || !offset) {
> - /*
> - * The page may have dirty, unmapped buffers. For example,
> - * they may have been added in ext3_writepage(). Make them
> - * freeable here, so the page does not leak.
> - */
> - do_invalidatepage(page, 0);
> unlock_page(page);
> - return 0; /* don't care */
> + return 0;
> }
>
> /*
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2009-07-10 11:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 7:30 [patch 0/5] new truncate sequence patchset npiggin
2009-07-10 7:30 ` [patch 1/5] fs: new truncate helpers npiggin
2009-07-10 7:30 ` [patch 2/5] fs: use " npiggin-l3A5Bk7waGM
2009-07-10 7:30 ` [patch 3/5] fs: introduce new truncate sequence npiggin
2009-07-10 7:30 ` [patch 4/5] tmpfs: convert to use the new truncate convention npiggin
2009-07-10 7:30 ` [patch 5/5] ext2: " npiggin
2009-09-01 18:29 ` Jan Kara
2009-09-02 9:14 ` Nick Piggin
2009-09-02 11:14 ` Jan Kara
2009-07-10 9:33 ` [patch 1/3] fs: buffer_head writepage no invalidate Nick Piggin
2009-07-10 9:34 ` [patch 2/3] fs: buffer_head writepage no zero Nick Piggin
2009-07-10 11:46 ` Jan Kara
2009-07-13 6:54 ` Nick Piggin
2009-07-10 9:35 ` [patch 3/3] fs: buffer_head page_lock i_size relax Nick Piggin
2009-07-10 11:08 ` Jan Kara [this message]
2009-07-10 14:31 ` [patch 0/5] new truncate sequence patchset Christoph Hellwig
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=20090710110815.GI17524@duck.suse.cz \
--to=jack@suse.cz \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--cc=viro@zeniv.linux.org.uk \
/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).