linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] iomap: zero dirty pages over unwritten extents
@ 2020-10-12 14:03 Brian Foster
  2020-10-12 14:03 ` [PATCH 1/2] iomap: use page dirty state to seek data " Brian Foster
  2020-10-12 14:03 ` [PATCH 2/2] iomap: zero cached pages over unwritten extents on zero range Brian Foster
  0 siblings, 2 replies; 18+ messages in thread
From: Brian Foster @ 2020-10-12 14:03 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-xfs

Hi all,

This is an alternate/iomap based variant of the XFS fix posted here:

https://lore.kernel.org/linux-xfs/20201007143509.669729-1-bfoster@redhat.com/

This addresses a post-eof stale data exposure problem that can occur
when truncate down races with writeback of the new EOF page and the new
EOF block happens to be unwritten. Instead of explicitly flushing the
new EOF page in XFS, however, this variant updates iomap zero range to
check for and zero preexisting dirty pages over unwritten extents. This
reuses the dirty page checking that seek data/hole already implements
for unwritten extents. Patch 1 is technically not required, but fixes an
odd behavior I noticed when playing around with zero range. Without it,
a zero range (with patch 2) over a large, cached (but clean), unwritten
mapping would unnecessarily zero pages that aren't otherwise dirty. I
don't think this is actually a problem in practice today as most large
zero range requests are truncates over post-eof space (which shouldn't
have page cache), but it seemed odd regardless.

Thoughts, reviews, flames appreciated.

Brian

Brian Foster (2):
  iomap: use page dirty state to seek data over unwritten extents
  iomap: zero cached pages over unwritten extents on zero range

 fs/iomap/buffered-io.c | 39 +++++++++++++++++++++++++++++++++++++--
 fs/iomap/seek.c        |  7 ++++---
 include/linux/iomap.h  |  2 ++
 3 files changed, 43 insertions(+), 5 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-10-29  2:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 14:03 [PATCH 0/2] iomap: zero dirty pages over unwritten extents Brian Foster
2020-10-12 14:03 ` [PATCH 1/2] iomap: use page dirty state to seek data " Brian Foster
2020-10-13 12:30   ` Brian Foster
2020-10-13 22:53   ` Dave Chinner
2020-10-14 12:59     ` Brian Foster
2020-10-14 22:37       ` Dave Chinner
2020-10-15  9:47   ` Christoph Hellwig
2020-10-19 16:55     ` Brian Foster
2020-10-27 18:07       ` Christoph Hellwig
2020-10-28 11:31         ` Brian Foster
2020-10-12 14:03 ` [PATCH 2/2] iomap: zero cached pages over unwritten extents on zero range Brian Foster
2020-10-15  9:49   ` Christoph Hellwig
2020-10-19 16:55     ` Brian Foster
2020-10-19 18:01       ` Brian Foster
2020-10-20 16:21         ` Brian Foster
2020-10-27 18:15           ` Christoph Hellwig
2020-10-28 11:31             ` Brian Foster
2020-10-23  1:02   ` [iomap] 11b5156248: xfstests.xfs.310.fail kernel test robot

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).