All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Monakhov <dmonakhov@openvz.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [patch] RFC directio: partial writes support
Date: Tue, 2 Mar 2010 23:37:11 +1100	[thread overview]
Message-ID: <20100302123711.GJ8653@laptop> (raw)
In-Reply-To: <20100302113406.GA4763@quack.suse.cz>

On Tue, Mar 02, 2010 at 12:34:06PM +0100, Jan Kara wrote:
> On Tue 02-03-10 20:25:02, Nick Piggin wrote:
> > On Mon, Mar 01, 2010 at 03:21:49PM -0800, Andrew Morton wrote:
> > > On Thu, 25 Feb 2010 15:45:58 +0300
> > > Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> > > 
> > > > Can someone please describe me why directio deny partial writes.
> > > > For example if someone try to write 100Mb but file system has less
> > > > data it return ENOSPC in the middle of block allocation.
> > > > All allocated blocks will be truncated (it may be 100Mb -4k) end
> > > > ENOSPC will be returned. As far as i remember direct_io always act
> > > > like this, but i never asked why?
> > > > Why do we have to give up all the progress we made?
> > > > In fact partial writes are possible in case of holes, when we 
> > > > fall back to buffered write. XFS implemented partial writes.
> > > 
> > > The problem with direct-io writes is that the writes don't necessarily
> > > complete in file-offset-ascending order.  So if we've issued 50 write
> > > BIOs and then hit an EIO on a BIO then we could have a hunk of
> > > unwritten data with newly-writted data either side of it.  If we get a
> > > bunch of discontiguous EIO BIOs coming in then the problem gets even
> > > messier - we have a span of disk which has a random mix of
> > > correctly-written and not-correctly-written runs of sectors.  What do
> > > we do with that?
> > 
> > Hmm, what if we're filling in a hole with direct IO? I don't see where
> > blocks allocated in DIO code will be trimmed on a failed write (because
> > it's within isize). This could cause uninitalized data of the block to
> > leak couldn't it?
>   The trick is that blockdev_direct_IO is defined to pass
> DIO_SKIP_HOLES to __blockdev_direct_IO. Thus e.g. ext2 or ext3 will just
> fail the direct IO if there is a hole and we fall back to buffered IO
> which should handle that just fine.

OK yes I see, I missed that.



      reply	other threads:[~2010-03-02 12:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 12:45 [patch] RFC directio: partial writes support Dmitry Monakhov
2010-02-27 11:10 ` Dmitry Monakhov
2010-03-01 23:21 ` Andrew Morton
2010-03-02  9:25   ` Nick Piggin
2010-03-02 11:34     ` Jan Kara
2010-03-02 12:37       ` Nick Piggin [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=20100302123711.GJ8653@laptop \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=dmonakhov@openvz.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.