All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-xfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/4] xfs: eof trim writeback mapping as soon as it is cached
Date: Wed, 16 Jan 2019 09:10:00 -0500	[thread overview]
Message-ID: <20190116141000.GA29871@bfoster> (raw)
In-Reply-To: <20190116133539.7BD5620675@mail.kernel.org>

On Wed, Jan 16, 2019 at 01:35:38PM +0000, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 40214d128e07 xfs: trim writepage mapping to within eof.
> 
> The bot has tested the following trees: v4.20.2, v4.19.15, v4.14.93, v4.9.150.
> 
> v4.20.2: Build OK!
> v4.19.15: Build OK!
> v4.14.93: Failed to apply! Possible dependencies:
>     2d5f4b5bebcc ("xfs: remove unused parameter from xfs_writepage_map")
>     5c665e5b5af6 ("xfs: remove xfs_map_cow")
>     70c57dcd606f ("xfs: skip CoW writes past EOF when writeback races with truncate")
>     a7b28f72ab90 ("xfs: don't use XFS_BMAPI_IGSTATE in xfs_map_blocks")
>     b4d8ad7fd3a1 ("xfs: fix s_maxbytes overflow problems")
> 
> v4.9.150: Failed to apply! Possible dependencies:
>     08438b1e386b ("xfs: plumb in needed functions for range querying of the freespace btrees")
>     092d5d9d5812 ("xfs: cleanup xfs_reflink_find_cow_mapping")
>     11ef38afe98c ("xfs: make xfs btree stats less huge")
>     2d5f4b5bebcc ("xfs: remove unused parameter from xfs_writepage_map")
>     5c665e5b5af6 ("xfs: remove xfs_map_cow")
>     70c57dcd606f ("xfs: skip CoW writes past EOF when writeback races with truncate")
>     755c7bf5ddca ("libxfs: convert ushort to unsigned short")
>     a7b28f72ab90 ("xfs: don't use XFS_BMAPI_IGSTATE in xfs_map_blocks")
>     af7d20fd83d9 ("xfs: make xfs_btree_magic more generic")
>     b4d8ad7fd3a1 ("xfs: fix s_maxbytes overflow problems")
>     c8ce540db5f6 ("xfs: remove double-underscore integer types")
>     cae028df5344 ("xfs: optimise CRC updates")
> 
> 
> How should we proceed with this patch?
> 

The writeback code in XFS has seen a decent amount of rework since these
older kernels. I'm not quite sure how stable deals with these conflicts,
but for reference, I think the appended (untested) diff is essentially
equivalent for the above two kernels. It doesn't cover the xfs_map_cow()
case in 4.14, but that code is experimental. Also note that the upstream
patch is still technically not reviewed.

Brian

--- 8< ---

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index b0cccf8a81a8..b93b3064de20 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -421,8 +421,10 @@ xfs_map_blocks(
 	    (!nimaps || isnullstartblock(imap->br_startblock))) {
 		error = xfs_iomap_write_allocate(ip, XFS_DATA_FORK, offset,
 				imap);
-		if (!error)
+		if (!error) {
 			trace_xfs_map_blocks_alloc(ip, offset, count, type, imap);
+			xfs_trim_extent_eof(imap, ip);
+		}
 		return error;
 	}
 
@@ -433,8 +435,10 @@ xfs_map_blocks(
 		ASSERT(imap->br_startblock != DELAYSTARTBLOCK);
 	}
 #endif
-	if (nimaps)
+	if (nimaps) {
 		trace_xfs_map_blocks_found(ip, offset, count, type, imap);
+		xfs_trim_extent_eof(imap, ip);
+	}
 	return 0;
 }
 

  reply	other threads:[~2019-01-16 14:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 12:30 [PATCH 0/4] xfs: properly invalidate cached writeback mapping Brian Foster
2019-01-11 12:30 ` [PATCH 1/4] xfs: eof trim writeback mapping as soon as it is cached Brian Foster
2019-01-16 13:35   ` Sasha Levin
2019-01-16 13:35     ` Sasha Levin
2019-01-16 14:10     ` Brian Foster [this message]
2019-01-11 12:30 ` [PATCH 2/4] xfs: update fork seq counter on data fork changes Brian Foster
2019-01-17 14:41   ` Christoph Hellwig
2019-01-11 12:30 ` [PATCH 3/4] xfs: validate writeback mapping using data fork seq counter Brian Foster
2019-01-13 21:49   ` Dave Chinner
2019-01-14 15:34     ` Brian Foster
2019-01-14 20:57       ` Dave Chinner
2019-01-15 11:26         ` Brian Foster
2019-01-17 14:47       ` Christoph Hellwig
2019-01-17 16:35         ` Brian Foster
2019-01-17 16:41           ` Christoph Hellwig
2019-01-17 17:53             ` Brian Foster
2019-01-11 12:30 ` [PATCH 4/4] xfs: remove superfluous writeback mapping eof trimming Brian Foster
2019-01-11 13:31 ` [PATCH] tests/generic: test writepage cached mapping validity Brian Foster
2019-01-14  9:30   ` Eryu Guan
2019-01-14 15:34     ` Brian Foster
2019-01-15  3:52     ` Dave Chinner

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=20190116141000.GA29871@bfoster \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@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.