All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Jiaying Zhang <jiayingz@google.com>,
	tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: use vmtruncate() instead of ext4_truncate() in ext4_setattr()
Date: Wed, 18 May 2011 09:05:22 -0500	[thread overview]
Message-ID: <4DD3D222.4050900@redhat.com> (raw)
In-Reply-To: <20110518061356.GY19446@dastard>

On 5/18/11 1:13 AM, Dave Chinner wrote:

> It's entirely up to the filesystem how it treats blocks beyond EOF
> during truncation. XFS frees them on truncate down, because it is
> much safer to just truncate away everything beyond the new EOF than
> to leave written extents beyond EOF as potential landmines.
> 
> Indeed, that's why calling vmtruncate() as a bad fix. If you have:
> 
> 
> 	       NUUUUUUUUUUWWWWWWWWWOUUUUUUUUU
>        ....----+----------+--------+--------+
>                A	  B        C        D
> 
> Where	A = new EOF (N)
> 	A->B = unwritten (U)
> 	B->C = written (W)
> 	C = old EOF (O)
> 	C->D = unwritten (U)
> 
> Then just calling vmtruncate() will leave the blocks in the range
> B->C as written blocks. Hence then doing an extending truncate back
> out to D will expose stale data rather than zeros in the range
> B->C....

Hm, running recent xfstests which includes fsx-with-fallocate should probably
eventually catch that then.

-Eric
 
> Cheers,
> 
> Dave.


  reply	other threads:[~2011-05-18 14:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 22:59 [PATCH] ext4: use vmtruncate() instead of ext4_truncate() in ext4_setattr() Jiaying Zhang
2011-05-18  2:46 ` Yongqiang Yang
2011-05-18  2:56 ` Yongqiang Yang
2011-05-18  3:27   ` Yongqiang Yang
2011-05-18  3:19 ` Eric Sandeen
2011-05-18  5:35   ` Andreas Dilger
2011-05-18 20:32     ` Jiaying Zhang
2011-05-18 20:45       ` Andreas Dilger
2011-05-18 20:57         ` Jiaying Zhang
2011-05-18  6:13   ` Dave Chinner
2011-05-18 14:05     ` Eric Sandeen [this message]
2011-05-18 20:42     ` Jiaying Zhang
2011-05-18 20:29   ` Jiaying Zhang
     [not found]   ` <BANLkTi=Yv_q820aHFa2wkCL-PnYNcZdWCQ@mail.gmail.com>
2011-05-18 20:31     ` Eric Sandeen
2011-05-18 20:38       ` Jiaying Zhang
2011-05-22 23:56 ` Ted Ts'o
2011-05-23 18:30   ` Jiaying Zhang
2011-05-23 19:19     ` [PATCH -v2] ext4: use truncate_setsize() unconditionally Theodore Ts'o
2011-05-23 20:22       ` Jiaying Zhang
2011-05-24 14:30       ` Eric Sandeen
2011-05-24 22:06         ` Jiaying Zhang
2011-05-24 22:31           ` Eric Sandeen

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=4DD3D222.4050900@redhat.com \
    --to=sandeen@redhat.com \
    --cc=david@fromorbit.com \
    --cc=jiayingz@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --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 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.