All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 4/4] xfs: remove unnecessary flush of eof page from truncate
Date: Thu, 18 Jul 2024 09:02:12 -0400	[thread overview]
Message-ID: <20240718130212.23905-5-bfoster@redhat.com> (raw)
In-Reply-To: <20240718130212.23905-1-bfoster@redhat.com>

The EOF flush was originally added to work around broken
iomap_zero_range() handling of dirty cache over unwritten extents.
Now that iomap handles this situation correctly, the flush can be
removed.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_iops.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index ff222827e550..eb0b7a88776d 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -862,16 +862,6 @@ xfs_setattr_size(
 		error = xfs_zero_range(ip, oldsize, newsize - oldsize,
 				&did_zeroing);
 	} else {
-		/*
-		 * iomap won't detect a dirty page over an unwritten block (or a
-		 * cow block over a hole) and subsequently skips zeroing the
-		 * newly post-EOF portion of the page. Flush the new EOF to
-		 * convert the block before the pagecache truncate.
-		 */
-		error = filemap_write_and_wait_range(inode->i_mapping, newsize,
-						     newsize);
-		if (error)
-			return error;
 		error = xfs_truncate_page(ip, newsize, &did_zeroing);
 	}
 
-- 
2.45.0


  parent reply	other threads:[~2024-07-18 13:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-18 13:02 [PATCH RFC 0/4] iomap: zero dirty folios over unwritten mappings on zero range Brian Foster
2024-07-18 13:02 ` [PATCH 1/4] filemap: return pos of first dirty folio from range_has_writeback Brian Foster
2024-07-18 15:09   ` Matthew Wilcox
2024-07-18 16:03     ` Brian Foster
2024-07-18 13:02 ` [PATCH 2/4] iomap: refactor an iomap_revalidate() helper Brian Foster
2024-07-18 13:02 ` [PATCH 3/4] iomap: fix handling of dirty folios over unwritten extents Brian Foster
2024-07-19  0:25   ` Dave Chinner
2024-07-19 15:17     ` Brian Foster
2024-07-18 13:02 ` Brian Foster [this message]
2024-07-18 15:36 ` [PATCH RFC 0/4] iomap: zero dirty folios over unwritten mappings on zero range Josef Bacik
2024-07-18 16:02   ` Darrick J. Wong
2024-07-18 16:40     ` Brian Foster
2024-07-19  1:10 ` Dave Chinner
2024-07-19 15:22   ` Brian Foster

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=20240718130212.23905-5-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@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.