From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Jan Kara <jack@suse.cz>
Cc: cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/3] ext4: Check for only delay or unwritten buffer_heads
Date: Thu, 28 May 2009 15:19:29 +0530 [thread overview]
Message-ID: <20090528094929.GA27978@skywalker> (raw)
In-Reply-To: <20090528082711.GB29199@duck.suse.cz>
On Thu, May 28, 2009 at 10:27:11AM +0200, Jan Kara wrote:
> On Wed 27-05-09 21:28:07, Aneesh Kumar K.V wrote:
> > Even with changes to make pages writeprotech on truncate/i_size update we
> > can still see buffer_heads which are not mapped in the writepage
> > callback. Consider the below case.
> >
> > 1) truncate(f, 1024)
> > 2) mmap(f, 0, 4096)
> > 3) a[0] = 'a'
> > 4) truncate(f, 4096)
> > 5) writepage(...)
> >
> > Now if we get a writepage callback immediately after (4) and before an
> > attempt to write at any other offset via mmap address (which implies we
> > are yet to get a pagefault and do a get_block) what we would have is the
> > page which is dirty have first block allocated and the other three
> > buffer_heads unmapped.
> >
> > In the above case the writepage should go ahead and try to write
> > the first blocks and clear the page_dirty flag. Because the further
> > attempt to write to the page will again create a fault and result in
> > allocating blocks and marking page dirty. Also if we don't write
> > any other offset via mmap address we would still have written the first
> > block to the disk and rest of the space will be considered as a hole.
> OK, but this requires my patches to not cause data loss, doesn't it?
> Nothing prevents user from writing data into the full page just after
> truncate(f, 4096) before the writepage is called. And without my patches,
> fault will not happen for such user write.
> Just that we should have this dependency in mind. Otherwise the patch
> looks fine to me.
Yes the entire series is on top of your patches
-aneesh
next prev parent reply other threads:[~2009-05-28 9:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 15:58 [PATCH 1/3] ext4: Don't look at buffer_heads outside i_size Aneesh Kumar K.V
2009-05-27 15:58 ` [PATCH 2/3] ext4: Check for only delay or unwritten buffer_heads Aneesh Kumar K.V
2009-05-27 15:58 ` [PATCH 3/3] ext4: Add generic writepage callback Aneesh Kumar K.V
2009-05-28 8:33 ` Jan Kara
2009-06-03 22:53 ` Theodore Tso
2009-06-03 22:57 ` Theodore Tso
2009-06-04 6:28 ` Aneesh Kumar K.V
2009-05-28 8:27 ` [PATCH 2/3] ext4: Check for only delay or unwritten buffer_heads Jan Kara
2009-05-28 9:49 ` Aneesh Kumar K.V [this message]
2009-05-27 16:27 ` [PATCH 1/3] ext4: Don't look at buffer_heads outside i_size Josef Bacik
2009-05-28 8:21 ` Jan Kara
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=20090528094929.GA27978@skywalker \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=cmm@us.ibm.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/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).