linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-ext4@vger.kernel.org, Nick Piggin <npiggin@suse.de>
Subject: Re: [PATCH 3/4] fs: Avoid data corruption with blocksize < pagesize
Date: Wed, 18 Mar 2009 19:50:15 +0100	[thread overview]
Message-ID: <20090318185015.GA1129@duck.suse.cz> (raw)
In-Reply-To: <20090318184222.GA6369@skywalker>

On Thu 19-03-09 00:12:22, Aneesh Kumar K.V wrote:
> On Tue, Mar 17, 2009 at 06:33:54PM +0100, Jan Kara wrote:
> > Assume the following situation:
> > Filesystem with blocksize < pagesize - suppose blocksize = 1024,
> > pagesize = 4096. File 'f' has first four blocks already allocated.
> > (line with "state:" contains the state of buffers in the page - m = mapped,
> > u = uptodate, d = dirty)
> > 
> >   process 1:                       process 2:
> > 
> > write to 'f' bytes 0 - 1024
> >   state: |mud,-,-,-|, page dirty
> >                                    write to 'f' bytes 1024 - 4096:
> >                                      __block_prepare_write() maps blocks
> >                                        state: |mud,m,m,m|, page dirty
> >                                      we fail to copy data -> copied = 0
> >                                      block_write_end() does nothing
> >                                      page gets unlocked
> 
> 
> If copied = 0 then in  block_write_end we do
> 
> page_zero_new_buffers(page, start+copied, start+len
> 
> which would mean we should not see garbage.
  But this will zero only *new* buffers - so if they are already allocated,
get_block() won't set new flag and they won't be zeroed...
  But I'm not saying I understand why this seems to help against a corruption
under UML because we don't seem to be writing !uptodate buffers there.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2009-03-18 18:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 17:33 [PATCH 0/4] Fix bugs and possible data corruption if blocksize < pagesize Jan Kara
2009-03-17 17:33 ` [PATCH 1/4] ext3: Fix false EIO errors Jan Kara
2009-03-17 17:33   ` [PATCH 2/4] ext3: Avoid " Jan Kara
2009-03-17 17:33     ` [PATCH 3/4] fs: Avoid data corruption with blocksize < pagesize Jan Kara
2009-03-17 17:33       ` [PATCH 4/4] fs: Warn about writing !uptodate buffers Jan Kara
2009-03-18 12:07         ` Nick Piggin
2009-03-18 12:00       ` [PATCH 3/4] fs: Avoid data corruption with blocksize < pagesize Nick Piggin
2009-03-18 14:13         ` Jan Kara
2009-03-18 18:57         ` Jan Kara
2009-03-18 18:42       ` Aneesh Kumar K.V
2009-03-18 18:50         ` Jan Kara [this message]

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=20090318185015.GA1129@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    /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).