Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH V2] xfs: remove duplicated lines
@ 2026-11-26 13:59 Zizhi Wo
  2026-11-26 14:15 ` Carlos Maiolino
  2026-11-30 12:52 ` Christoph Hellwig
  0 siblings, 2 replies; 8+ messages in thread
From: Zizhi Wo @ 2026-11-26 13:59 UTC (permalink / raw)
  To: cem, dgc, djwong, hch, linux-xfs
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

From: Zizhi Wo <wozizhi@huawei.com>

Remove duplicated lines:
- xfs_ondisk.h checks the size of struct xfs_attrlist twice.
- xfs_rtgroup.h declares xfs_rtginode_irele() twice.

No functional changes.

Fixes: 650b774cf944 ("xfs: add static size checks for ioctl UABI")
Fixes: 6b08901a6e8f ("xfs: add realtime reverse map inode to metadata directory")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
---
 fs/xfs/libxfs/xfs_ondisk.h  | 1 -
 fs/xfs/libxfs/xfs_rtgroup.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
index 23cde1248f01..ae16b1bc2bbe 100644
--- a/fs/xfs/libxfs/xfs_ondisk.h
+++ b/fs/xfs/libxfs/xfs_ondisk.h
@@ -303,11 +303,10 @@ xfs_check_ondisk_structs(void)
 	XFS_CHECK_STRUCT_SIZE(struct dioattr,			12);
 	XFS_CHECK_STRUCT_SIZE(struct getbmap,			32);
 	XFS_CHECK_STRUCT_SIZE(struct getbmapx,			48);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor,	16);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
-	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent,		4);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry,		128);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry,	128);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_error_injection,	8);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_geom,		256);
diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
index fca2eb74908c..e505be68462b 100644
--- a/fs/xfs/libxfs/xfs_rtgroup.h
+++ b/fs/xfs/libxfs/xfs_rtgroup.h
@@ -326,12 +326,10 @@ int xfs_rtginode_load(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
 		struct xfs_trans *tp);
 int xfs_rtginode_create(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
 		bool init);
 void xfs_rtginode_irele(struct xfs_inode **ipp);
 
-void xfs_rtginode_irele(struct xfs_inode **ipp);
-
 static inline const char *xfs_rtginode_path(xfs_rgnumber_t rgno,
 		enum xfs_rtg_inodes type)
 {
 	return kasprintf(GFP_KERNEL, "%u.%s", rgno, xfs_rtginode_name(type));
 }
-- 
2.52.0


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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-26 13:59 [PATCH V2] xfs: remove duplicated lines Zizhi Wo
@ 2026-11-26 14:15 ` Carlos Maiolino
  2026-11-30 12:52 ` Christoph Hellwig
  1 sibling, 0 replies; 8+ messages in thread
From: Carlos Maiolino @ 2026-11-26 14:15 UTC (permalink / raw)
  To: Zizhi Wo
  Cc: dgc, djwong, hch, linux-xfs, linux-kernel, yangerkun,
	chengzhihao1, wozizhi

On Thu, Nov 26, 2026 at 09:59:47PM +0800, Zizhi Wo wrote:
> From: Zizhi Wo <wozizhi@huawei.com>
> 
> Remove duplicated lines:
> - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
> - xfs_rtgroup.h declares xfs_rtginode_irele() twice.
> 
> No functional changes.
> 
> Fixes: 650b774cf944 ("xfs: add static size checks for ioctl UABI")
> Fixes: 6b08901a6e8f ("xfs: add realtime reverse map inode to metadata directory")
> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>

Looks good.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_ondisk.h  | 1 -
>  fs/xfs/libxfs/xfs_rtgroup.h | 2 --
>  2 files changed, 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
> index 23cde1248f01..ae16b1bc2bbe 100644
> --- a/fs/xfs/libxfs/xfs_ondisk.h
> +++ b/fs/xfs/libxfs/xfs_ondisk.h
> @@ -303,11 +303,10 @@ xfs_check_ondisk_structs(void)
>  	XFS_CHECK_STRUCT_SIZE(struct dioattr,			12);
>  	XFS_CHECK_STRUCT_SIZE(struct getbmap,			32);
>  	XFS_CHECK_STRUCT_SIZE(struct getbmapx,			48);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor,	16);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
> -	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent,		4);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry,		128);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry,	128);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_error_injection,	8);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_geom,		256);
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
> index fca2eb74908c..e505be68462b 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.h
> +++ b/fs/xfs/libxfs/xfs_rtgroup.h
> @@ -326,12 +326,10 @@ int xfs_rtginode_load(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
>  		struct xfs_trans *tp);
>  int xfs_rtginode_create(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
>  		bool init);
>  void xfs_rtginode_irele(struct xfs_inode **ipp);
>  
> -void xfs_rtginode_irele(struct xfs_inode **ipp);
> -
>  static inline const char *xfs_rtginode_path(xfs_rgnumber_t rgno,
>  		enum xfs_rtg_inodes type)
>  {
>  	return kasprintf(GFP_KERNEL, "%u.%s", rgno, xfs_rtginode_name(type));
>  }
> -- 
> 2.52.0
> 
> 

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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-26 13:59 [PATCH V2] xfs: remove duplicated lines Zizhi Wo
  2026-11-26 14:15 ` Carlos Maiolino
@ 2026-11-30 12:52 ` Christoph Hellwig
  2026-11-30 13:19   ` Zizhi Wo
  1 sibling, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2026-11-30 12:52 UTC (permalink / raw)
  To: Zizhi Wo
  Cc: cem, dgc, djwong, hch, linux-xfs, linux-kernel, yangerkun,
	chengzhihao1, wozizhi

On Thu, Nov 26, 2026 at 09:59:47PM +0800, Zizhi Wo wrote:
> From: Zizhi Wo <wozizhi@huawei.com>
> 
> Remove duplicated lines:
> - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
> - xfs_rtgroup.h declares xfs_rtginode_irele() twice.

These look entirely unrelated, why combine them into a patch?

> Fixes: 650b774cf944 ("xfs: add static size checks for ioctl UABI")
> Fixes: 6b08901a6e8f ("xfs: add realtime reverse map inode to metadata directory")

and no, removing dead lines is not a fix in the Fixes: tag sense.


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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-30 12:52 ` Christoph Hellwig
@ 2026-11-30 13:19   ` Zizhi Wo
  2026-11-30 13:22     ` Christoph Hellwig
  2026-11-30 13:37     ` Carlos Maiolino
  0 siblings, 2 replies; 8+ messages in thread
From: Zizhi Wo @ 2026-11-30 13:19 UTC (permalink / raw)
  To: Christoph Hellwig, Carlos Maiolino
  Cc: dgc, djwong, linux-xfs, linux-kernel, yangerkun, chengzhihao1,
	wozizhi

Hi,

在 2026/11/30 20:52, Christoph Hellwig 写道:
> On Thu, Nov 26, 2026 at 09:59:47PM +0800, Zizhi Wo wrote:
>> From: Zizhi Wo <wozizhi@huawei.com>
>>
>> Remove duplicated lines:
>> - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
>> - xfs_rtgroup.h declares xfs_rtginode_irele() twice.
> 
> These look entirely unrelated, why combine them into a patch?

I squashed them together because when I sent a similar dead-code cleanup
series earlier this year [1], Carlos suggested that trivial removals
like these don't really need to be split per-file and could live in one
patch. I took that as the preferred style for this kind of change.

Carlos, do you still feel the same way here, or would you rather I split
this into two patches in v3? I'm fine either way.

[1] https://lore.kernel.org/all/aprh7OnJPCL-iIIK@andromeda.toxiclabs.cc/

> 
>> Fixes: 650b774cf944 ("xfs: add static size checks for ioctl UABI")
>> Fixes: 6b08901a6e8f ("xfs: add realtime reverse map inode to metadata directory")
> 
> and no, removing dead lines is not a fix in the Fixes: tag sense.

Understood. I didn't add any fixtags in v1 since I considered this a
pure cleanup, but Carlos asked me to add them during the v1 review [2],
which is why they showed up in v2.

Carlos, could you clarify how you'd like this handled going forward? I'm
fine either way too...

[2] https://lore.kernel.org/all/awgy2d_SbrvHtvkI@cronus.toxiclabs.cc/


Thanks,
Zizhi Wo



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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-30 13:19   ` Zizhi Wo
@ 2026-11-30 13:22     ` Christoph Hellwig
  2026-11-30 13:35       ` Zizhi Wo
  2026-11-30 13:37     ` Carlos Maiolino
  1 sibling, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2026-11-30 13:22 UTC (permalink / raw)
  To: Zizhi Wo
  Cc: Christoph Hellwig, Carlos Maiolino, dgc, djwong, linux-xfs,
	linux-kernel, yangerkun, chengzhihao1, wozizhi

On Mon, Nov 30, 2026 at 09:19:34PM +0800, Zizhi Wo wrote:
> I squashed them together because when I sent a similar dead-code cleanup
> series earlier this year [1], Carlos suggested that trivial removals
> like these don't really need to be split per-file and could live in one
> patch. I took that as the preferred style for this kind of change.

Splitting up per file is obviously always a bad idea.  Splits should
be per logical change, and removing two totally unrelated duplicate
prototypes / forward declarations is not really only logical change
by any definition.


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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-30 13:22     ` Christoph Hellwig
@ 2026-11-30 13:35       ` Zizhi Wo
  0 siblings, 0 replies; 8+ messages in thread
From: Zizhi Wo @ 2026-11-30 13:35 UTC (permalink / raw)
  To: Christoph Hellwig, Zizhi Wo, Carlos Maiolino
  Cc: dgc, djwong, linux-xfs, linux-kernel, yangerkun, chengzhihao1



在 2026/11/30 21:22, Christoph Hellwig 写道:
> On Mon, Nov 30, 2026 at 09:19:34PM +0800, Zizhi Wo wrote:
>> I squashed them together because when I sent a similar dead-code cleanup
>> series earlier this year [1], Carlos suggested that trivial removals
>> like these don't really need to be split per-file and could live in one
>> patch. I took that as the preferred style for this kind of change.
> 
> Splitting up per file is obviously always a bad idea.  Splits should
> be per logical change, and removing two totally unrelated duplicate
> prototypes / forward declarations is not really only logical change
> by any definition.
> 

Understood. I'll send v3 as two separate patches.

Thanks,
Zizhi Wo


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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-30 13:19   ` Zizhi Wo
  2026-11-30 13:22     ` Christoph Hellwig
@ 2026-11-30 13:37     ` Carlos Maiolino
  2026-11-30 13:47       ` Christoph Hellwig
  1 sibling, 1 reply; 8+ messages in thread
From: Carlos Maiolino @ 2026-11-30 13:37 UTC (permalink / raw)
  To: Zizhi Wo
  Cc: Christoph Hellwig, dgc, djwong, linux-xfs, linux-kernel,
	yangerkun, chengzhihao1, wozizhi

On Mon, Nov 30, 2026 at 09:19:34PM +0800, Zizhi Wo wrote:
> Hi,
> 
> 在 2026/11/30 20:52, Christoph Hellwig 写道:
> > On Thu, Nov 26, 2026 at 09:59:47PM +0800, Zizhi Wo wrote:
> > > From: Zizhi Wo <wozizhi@huawei.com>
> > > 
> > > Remove duplicated lines:
> > > - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
> > > - xfs_rtgroup.h declares xfs_rtginode_irele() twice.
> > 
> > These look entirely unrelated, why combine them into a patch?
> 
> I squashed them together because when I sent a similar dead-code cleanup
> series earlier this year [1], Carlos suggested that trivial removals
> like these don't really need to be split per-file and could live in one
> patch. I took that as the preferred style for this kind of change.
> 
> Carlos, do you still feel the same way here, or would you rather I split
> this into two patches in v3? I'm fine either way.
> 
> [1] https://lore.kernel.org/all/aprh7OnJPCL-iIIK@andromeda.toxiclabs.cc/

Yes, that's on me. I don't see the point of removing dead code in
different patches unless there is a very good reason to do so.

This patch though has a slightly different goal than the series you
mentioned before though.  This is not removing dead code but duplicated
code added by mistake.  Which is not really dead codes as it's code
executed by the cpu (well, one hunk)...

But again, I particularly don't see a reason to split those in different
patches, unless Christoph thinks otherwise.

> 
> > 
> > > Fixes: 650b774cf944 ("xfs: add static size checks for ioctl UABI")
> > > Fixes: 6b08901a6e8f ("xfs: add realtime reverse map inode to metadata directory")
> > 
> > and no, removing dead lines is not a fix in the Fixes: tag sense.
> 
> Understood. I didn't add any fixtags in v1 since I considered this a
> pure cleanup, but Carlos asked me to add them during the v1 review [2],
> which is why they showed up in v2.
> 
> Carlos, could you clarify how you'd like this handled going forward? I'm
> fine either way too...
> 
> [2] https://lore.kernel.org/all/awgy2d_SbrvHtvkI@cronus.toxiclabs.cc/

Yes, that's on me too. I consider the duplicated lines a bug during the
implementation, but, perhaps my understanding of the Fixes: tag was
too literal, so leave it out as Christoph suggested.

If Christoph doesn't bother with both changes belonging to a single
patch, I can remove the Fixes: tag at the time I pull the patch. If he
prefers you to split it into two patches, then on next version you send
them without the Fixes:.

Cheers.

> 
> 
> Thanks,
> Zizhi Wo
> 
> 

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

* Re: [PATCH V2] xfs: remove duplicated lines
  2026-11-30 13:37     ` Carlos Maiolino
@ 2026-11-30 13:47       ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2026-11-30 13:47 UTC (permalink / raw)
  To: Carlos Maiolino
  Cc: Zizhi Wo, Christoph Hellwig, dgc, djwong, linux-xfs, linux-kernel,
	yangerkun, chengzhihao1, wozizhi

On Mon, Nov 30, 2026 at 02:37:01PM +0100, Carlos Maiolino wrote:
> But again, I particularly don't see a reason to split those in different
> patches, unless Christoph thinks otherwise.

The general rule is to have patches self-contained.  Touching totally
different things in one patch feels odd.  Although we probably spent
way too much time arguing about this by now :)

> > 
> > 
---end quoted text---

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

end of thread, other threads:[~2026-11-30 13:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 13:59 [PATCH V2] xfs: remove duplicated lines Zizhi Wo
2026-11-26 14:15 ` Carlos Maiolino
2026-11-30 12:52 ` Christoph Hellwig
2026-11-30 13:19   ` Zizhi Wo
2026-11-30 13:22     ` Christoph Hellwig
2026-11-30 13:35       ` Zizhi Wo
2026-11-30 13:37     ` Carlos Maiolino
2026-11-30 13:47       ` Christoph Hellwig

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