All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <namjae.jeon@samsung.com>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: RE: [PATCH 3/5] ext4: No need to truncate pagecache twice in collapse range
Date: Thu, 17 Apr 2014 09:41:45 +0900	[thread overview]
Message-ID: <003101cf59d5$cf1798d0$6d46ca70$@samsung.com> (raw)
In-Reply-To: <002d01cf59d4$c9a07a30$5ce16e90$@samsung.com>

> 
> We're already calling truncate_pagecache_range() before we attempt to
> do any actual job so there is not need to truncate pagecache once more
> using truncate_setsize() after we're finished.
> 
> Remove truncate_setsize() and replace it just with i_size_write() note
> that we're holding appropriate locks.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Hi Lukas.

I added this code by getting rewiew from Hugh.
Plz see the disscusion beween Hugh and Dave.

Hugh: But your case is different: collapse is much closer to truncation,
 and if you do not unmap the private COW'ed pages, then pages left
 behind beyond the EOF will break the spec that requires SIGBUS when
 touching there, and pages within EOF will be confusingly derived
 from file data now belonging to another offset or none (move these
 pages within the user address space? no, I don't think anon_vmas
 would allow that, and there may be no right place to move them).
 
Dave: See above - we never leave pages beyond the new EOF because setting
 the new EOF is a truncate operation that calls
 truncate_setsize(inode, newsize).
 
Hugh: Right, thanks, I now see the truncate_setsize() in the xfs case -
 though not in the ext4 case, which looks as if it's just doing an
 i_size_write() afterwards.

Dave: So that's a bug in the ext4 code ;)

truncate_setsize is not needed in case Hugh pointed out ?

Thanks!


       reply	other threads:[~2014-04-17  0:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <002d01cf59d4$c9a07a30$5ce16e90$@samsung.com>
2014-04-17  0:41 ` Namjae Jeon [this message]
2014-04-17  8:07   ` [PATCH 3/5] ext4: No need to truncate pagecache twice in collapse range Lukáš Czerner
2014-04-18  5:31     ` Namjae Jeon
2014-04-18  8:56       ` Lukáš Czerner
2014-04-16 18:32 [PATCH 1/5] ext4: Use filemap_write_and_wait_range() correctly " Lukas Czerner
2014-04-16 18:33 ` [PATCH 3/5] ext4: No need to truncate pagecache twice " Lukas Czerner
2014-04-18 14:49   ` Theodore Ts'o

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='003101cf59d5$cf1798d0$6d46ca70$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@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.