]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: fix libxfs_iget return value sign inversion
authorDarrick J. Wong <djwong@kernel.org>
Tue, 23 Sep 2025 17:08:57 +0000 (10:08 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 25 Sep 2025 09:18:10 +0000 (11:18 +0200)
libxfs functions return negative errno, so utilities must invert the
return values from such functions.  Caught by xfs/437.

Fixes: 8a4ea72724930c ("proto: add ability to populate a filesystem from a directory")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
mkfs/proto.c

index bfeeb5ac638185a7785c0e6a0d85a0642d164ad4..2b29240db95f7497b5fcd93a2b89a90c9218f061 100644 (file)
@@ -1425,7 +1425,7 @@ handle_hardlink(
        if (dst_ino == 0)
                return false;
 
-       error = libxfs_iget(mp, NULL, dst_ino, 0, &ip);
+       error = -libxfs_iget(mp, NULL, dst_ino, 0, &ip);
        if (error)
                fail(_("failed to get inode"), error);