[Devel] [PATCH vz10 1/2] xfs: use IS_ERR() instead of IS_ERR_OR_NULL() for xfs_balloon_get()

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 12 09:56:53 MSK 2026


xfs_balloon_get() returns either a valid inode or an ERR_PTR(); it never
returns NULL. xfs_fs_statfs() nevertheless checked its result with
IS_ERR_OR_NULL(), unlike the other two callers (xfs_balloon_check() and
the FS_IOC_SET_BALLOON ioctl) which use plain IS_ERR().

Switch xfs_fs_statfs() to IS_ERR() as well: it is sufficient and keeps
all xfs_balloon_get() call sites consistent. No functional change.

Fixes: f511955a759a ("xfs: Teach the fs where the balloon inode is")
Reported-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
https://virtuozzo.atlassian.net/browse/VSTOR-132310
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 4d291b9c5f8a..d24ceb045364 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -981,7 +981,7 @@ xfs_fs_statfs(
 		struct xfs_inode *bip;
 
 		bip = xfs_balloon_get(mp, balloon_ino, 0);
-		if (!IS_ERR_OR_NULL(bip)) {
+		if (!IS_ERR(bip)) {
 			/* Note, i_nblocks also contains metadata blocks */
 			st->f_blocks -= bip->i_nblocks + bip->i_delayed_blks;
 			xfs_irele(bip);
-- 
2.47.1



More information about the Devel mailing list