mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: remove duplicate INO1_WRITTEN check
@ 2026-09-14  8:21 Jiangshan Yi
  2026-09-14 14:52 ` Darrick J. Wong
  2026-09-16 12:06 ` Carlos Maiolino
  0 siblings, 2 replies; 3+ messages in thread
From: Jiangshan Yi @ 2026-09-14  8:21 UTC (permalink / raw)
  To: cem
  Cc: djwong, ljp1205831794, gaoyingjie, linux-xfs, linux-kernel,
	13667453960, Jiangshan Yi

Commit a23eca88448e ("xfs: fix exchange-range reflink flag clearing
issue with INO1_WRITTEN") duplicated commit b2d5a81dae38 ("xfs: fix
exchange-range reflink flag clearing issue with INO1_WRITTEN"), so
xmi_can_exchange_reflink_flags() ended up with two identical
XFS_EXCHMAPS_INO1_WRITTEN checks.  The second one is dead code,
since the first one already returned false.  Remove it.

Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
---
 fs/xfs/libxfs/xfs_exchmaps.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_exchmaps.c b/fs/xfs/libxfs/xfs_exchmaps.c
index 49eda8d0994d..3efed37cb98a 100644
--- a/fs/xfs/libxfs/xfs_exchmaps.c
+++ b/fs/xfs/libxfs/xfs_exchmaps.c
@@ -959,16 +959,6 @@ xmi_can_exchange_reflink_flags(
 {
 	struct xfs_mount		*mp = req->ip1->i_mount;
 
-	/*
-	 * The INO1_WRITTEN optimization can skip exchanging hole and
-	 * unwritten mappings, which means we cannot guarantee that all
-	 * shared extents actually moved to the other file.  Clearing the
-	 * reflink flag of an inode that still holds shared extents breaks
-	 * the CoW write path, so refuse to exchange the flags in that case.
-	 */
-	if (req->flags & XFS_EXCHMAPS_INO1_WRITTEN)
-		return false;
-
 	/*
 	 * The INO1_WRITTEN optimization can skip exchanging hole and
 	 * unwritten mappings, which means we cannot guarantee that all
-- 
2.25.1


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

* Re: [PATCH] xfs: remove duplicate INO1_WRITTEN check
  2026-09-14  8:21 [PATCH] xfs: remove duplicate INO1_WRITTEN check Jiangshan Yi
@ 2026-09-14 14:52 ` Darrick J. Wong
  2026-09-16 12:06 ` Carlos Maiolino
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2026-09-14 14:52 UTC (permalink / raw)
  To: Jiangshan Yi
  Cc: cem, ljp1205831794, gaoyingjie, linux-xfs, linux-kernel, 13667453960

On Mon, Sep 14, 2026 at 04:21:11PM +0800, Jiangshan Yi wrote:
> Commit a23eca88448e ("xfs: fix exchange-range reflink flag clearing
> issue with INO1_WRITTEN") duplicated commit b2d5a81dae38 ("xfs: fix
> exchange-range reflink flag clearing issue with INO1_WRITTEN"), so
> xmi_can_exchange_reflink_flags() ended up with two identical
> XFS_EXCHMAPS_INO1_WRITTEN checks.  The second one is dead code,
> since the first one already returned false.  Remove it.
> 
> Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>

Not sure why b2d5a81dae38 got committed twice, but yes this patch is
correct.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_exchmaps.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_exchmaps.c b/fs/xfs/libxfs/xfs_exchmaps.c
> index 49eda8d0994d..3efed37cb98a 100644
> --- a/fs/xfs/libxfs/xfs_exchmaps.c
> +++ b/fs/xfs/libxfs/xfs_exchmaps.c
> @@ -959,16 +959,6 @@ xmi_can_exchange_reflink_flags(
>  {
>  	struct xfs_mount		*mp = req->ip1->i_mount;
>  
> -	/*
> -	 * The INO1_WRITTEN optimization can skip exchanging hole and
> -	 * unwritten mappings, which means we cannot guarantee that all
> -	 * shared extents actually moved to the other file.  Clearing the
> -	 * reflink flag of an inode that still holds shared extents breaks
> -	 * the CoW write path, so refuse to exchange the flags in that case.
> -	 */
> -	if (req->flags & XFS_EXCHMAPS_INO1_WRITTEN)
> -		return false;
> -
>  	/*
>  	 * The INO1_WRITTEN optimization can skip exchanging hole and
>  	 * unwritten mappings, which means we cannot guarantee that all
> -- 
> 2.25.1
> 
> 

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

* Re: [PATCH] xfs: remove duplicate INO1_WRITTEN check
  2026-09-14  8:21 [PATCH] xfs: remove duplicate INO1_WRITTEN check Jiangshan Yi
  2026-09-14 14:52 ` Darrick J. Wong
@ 2026-09-16 12:06 ` Carlos Maiolino
  1 sibling, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2026-09-16 12:06 UTC (permalink / raw)
  To: Jiangshan Yi
  Cc: djwong, ljp1205831794, gaoyingjie, linux-xfs, linux-kernel, 13667453960

On Mon, 14 Sep 2026 16:21:11 +0800, Jiangshan Yi wrote:
> Commit a23eca88448e ("xfs: fix exchange-range reflink flag clearing
> issue with INO1_WRITTEN") duplicated commit b2d5a81dae38 ("xfs: fix
> exchange-range reflink flag clearing issue with INO1_WRITTEN"), so
> xmi_can_exchange_reflink_flags() ended up with two identical
> XFS_EXCHMAPS_INO1_WRITTEN checks.  The second one is dead code,
> since the first one already returned false.  Remove it.
> 
> [...]

Applied to for-next, thanks!

[1/1] xfs: remove duplicate INO1_WRITTEN check
      commit: ce2b91bebc7bc0495fe3ad5ee47e4977fbb77fc5

Best regards,
-- 
Carlos Maiolino <cem@kernel.org>


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

end of thread, other threads:[~2026-09-16 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14  8:21 [PATCH] xfs: remove duplicate INO1_WRITTEN check Jiangshan Yi
2026-09-14 14:52 ` Darrick J. Wong
2026-09-16 12:06 ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®