public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: David Chinner <dgc@sgi.com>, xfs-dev <xfs-dev@sgi.com>,
	xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH, RFC] fix null files exposure growing via ftruncate
Date: Fri, 15 Jun 2007 10:58:11 +1000	[thread overview]
Message-ID: <20070615005811.GJ86004887@sgi.com> (raw)
In-Reply-To: <20070614181446.GA16955@infradead.org>

On Thu, Jun 14, 2007 at 07:14:46PM +0100, Christoph Hellwig wrote:
> On Thu, Jun 14, 2007 at 04:34:04PM +1000, David Chinner wrote:
> > Christoph,
> > 
> > Looking into the test 140 failure you reported, I realised that none
> > of the specific null files tests were being run automatically, which
> > is why I hadn't seen any of those failures (nor had the QA team).
> > That's being fixed.
> > 
> > I suspect that the test passes on Irix because of a coincidence
> > (the test sleeps for 10s and that is the default writeback
> > timeout for file data) which means when the filesystem is shut down
> > all the data is already on disk so it's not really testing
> > the NULL files fix.
> > 
> > The failure is due to the ftruncate() logging the new file size
> > before any data that had previously been written had hit the
> > disk. IOWs, it violates the data write/inode size update rule
> > that fixes the null files problem.
> > 
> > The fix here checks when growing the file as to whether it the disk
> > inode size is different to the in memory size. If they are
> > different, we have data that needs to be written to disk beyond the
> > existing on disk EOF. Hence to maintain ordering we need to flush
> > this data out before we log the changed file size.
> > 
> > I suspect the flush could be done more optimally - I've just done a
> > brute-force flush the entire file mod. Should we only flush from the
> > old di_size to the current i_size?
> > 
> > There may also be better ways to fix this. Any thoughts on
> > that?
> 
> Looks good enough for now, but I suspect just flushing from the old
> to the new size would be a quite nice performance improvement that's
> worth it.

Yeah, that's the way I was leaning. I'll mod the patch to do that and
repost. Thanks.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

      reply	other threads:[~2007-06-15  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14  6:34 [PATCH, RFC] fix null files exposure growing via ftruncate David Chinner
2007-06-14 18:14 ` Christoph Hellwig
2007-06-15  0:58   ` David Chinner [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=20070615005811.GJ86004887@sgi.com \
    --to=dgc@sgi.com \
    --cc=hch@infradead.org \
    --cc=xfs-dev@sgi.com \
    --cc=xfs@oss.sgi.com \
    /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