Skip to contentSkip to conversation

xfs: fix returned valued from xfs_defer_can_append

PATCH Applied [email protected] 3 participants 4 messages Mar 4 – Mar 5 XFS filesystem

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 xfs: fix returned valued from xfs_defer_can_append

From: Carlos Maiolino <[email protected]>

xfs_defer_can_append returns a bool, it shouldn't be returning a NULL.

Found by code inspection.

Fixes 4dffb2cbb483 ("xfs: allow pausing of pending deferred work items")
---
 fs/xfs/libxfs/xfs_defer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_defer.c +1 -1
index 472c261163ed..c6909716b041 100644
@@ -809,7 +809,7 @@ xfs_defer_can_append(
 
 	/* Paused items cannot absorb more work */
 	if (dfp->dfp_flags & XFS_DEFER_PAUSED)
-		return NULL;
+		return false;
 
 	/* Already full? */
 	if (ops->max_items && dfp->dfp_count >= ops->max_items)
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Wed, Mar 04, 2026 at 07:54:27PM +0100, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

xfs_defer_can_append returns a bool, it shouldn't be returning a NULL.

Found by code inspection.

Fixes 4dffb2cbb483 ("xfs: allow pausing of pending deferred work items")

Yep, that's a bug. Fortunately a benign one.

--D

Quoted 21 lines
---
 fs/xfs/libxfs/xfs_defer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_defer.c +1 -1
index 472c261163ed..c6909716b041 100644
@@ -809,7 +809,7 @@ xfs_defer_can_append(
 
 	/* Paused items cannot absorb more work */
 	if (dfp->dfp_flags & XFS_DEFER_PAUSED)
-		return NULL;
+		return false;
 
 	/* Already full? */
 	if (ops->max_items && dfp->dfp_count >= ops->max_items)
Signature · 1 line
2.53.0
Reviewed-by Darrick J. Wong Acked-by
#2 lore raw

-----Original Message-----
From: Darrick J. Wong <[email protected]>
Sent: Thursday, March 5, 2026 1:21 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] xfs: fix returned valued from xfs_defer_can_append

Quoted 10 lines · On Wed, Mar 04, 2026 at 07:54:27PM +0100, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

xfs_defer_can_append returns a bool, it shouldn't be returning a NULL.

Found by code inspection.

Fixes 4dffb2cbb483 ("xfs: allow pausing of pending deferred work

items")

Yep, that's a bug. Fortunately a benign one.

--D

Quoted 21 lines
---
 fs/xfs/libxfs/xfs_defer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_defer.c +1 -2
index 472c261163ed..c6909716b041 100644
@@ -809,7 +809,7 @@ xfs_defer_can_append(
 
 	/* Paused items cannot absorb more work */
 	if (dfp->dfp_flags & XFS_DEFER_PAUSED)
-		return NULL;
+		return false;
 
 	/* Already full? */
 	if (ops->max_items && dfp->dfp_count >= ops->max_items)
--

2.53.0

author maintainer Applied
#3 lore raw
In reply to [email protected]
Quoted 6 lines · On Wed, 04 Mar 2026 19:54:27 +0100, [email protected] wrote:

xfs_defer_can_append returns a bool, it shouldn't be returning a NULL.

Found by code inspection.

Applied to for-next, thanks!

[1/1] xfs: fix returned valued from xfs_defer_can_append

      commit: 625f2cf0ed12953313970a80c7d501e9150251a9

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>