linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mkfs: fix libxfs_iget return value sign inversion
@ 2025-09-23 17:08 Darrick J. Wong
  2025-09-23 17:10 ` [PATCH 2/2] libfrog: pass mode to xfrog_file_setattr Darrick J. Wong
  2025-09-24  9:03 ` [PATCH 1/2] mkfs: fix libxfs_iget return value sign inversion Andrey Albershteyn
  0 siblings, 2 replies; 5+ messages in thread
From: Darrick J. Wong @ 2025-09-23 17:08 UTC (permalink / raw)
  To: Andrey Albershteyn; +Cc: xfs

From: Darrick J. Wong <djwong@kernel.org>

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>
---
 mkfs/proto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/proto.c b/mkfs/proto.c
index bfeeb5ac638185..2b29240db95f74 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -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);
 

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

end of thread, other threads:[~2025-09-24 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 17:08 [PATCH 1/2] mkfs: fix libxfs_iget return value sign inversion Darrick J. Wong
2025-09-23 17:10 ` [PATCH 2/2] libfrog: pass mode to xfrog_file_setattr Darrick J. Wong
2025-09-24 13:18   ` Andrey Albershteyn
2025-09-24 21:52     ` Darrick J. Wong
2025-09-24  9:03 ` [PATCH 1/2] mkfs: fix libxfs_iget return value sign inversion Andrey Albershteyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).