Skip to contentSkip to conversation

xfsprogs: fix endian mishap in xfs_dialloc_ag()

PATCH In review Eric Sandeen 2 participants 2 messages Oct 23, 2014 – Oct 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: fix endian mishap in xfs_dialloc_ag()

Fixes a regression introduced by:

88fc730 xfs: use and update the finobt on inode allocation

which passed the non-swapped version of agi->agi_newino to xfs_inobt_lookup()

Caught by make C=2, ftw!

---

libxfs/xfs_ialloc.c +2 -1
index 5462c54..b20a9ec 100644
@@ -1057,7 +1057,8 @@ xfs_dialloc_ag(
 		 * most recently allocated inode.
 		 */
 		if (agi->agi_newino != cpu_to_be32(NULLAGINO)) {
-			error = xfs_inobt_lookup(cur, agi->agi_newino,
+			error = xfs_inobt_lookup(cur,
+						 be32_to_cpu(agi->agi_newino),
 						 XFS_LOOKUP_EQ, &i);
 			if (error)
 				goto error_cur;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Sandeen

Fixes a regression introduced by:

88fc730 xfs: use and update the finobt on inode allocation

which passed the non-swapped version of agi->agi_newino to xfs_inobt_lookup()

Caught by make C=2, ftw!

---

Quoted 16 lines
libxfs/xfs_ialloc.c +2 -1
index 5462c54..b20a9ec 100644
@@ -1057,7 +1057,8 @@ xfs_dialloc_ag(
 		 * most recently allocated inode.
 		 */
 		if (agi->agi_newino != cpu_to_be32(NULLAGINO)) {
-			error = xfs_inobt_lookup(cur, agi->agi_newino,
+			error = xfs_inobt_lookup(cur,
+						 be32_to_cpu(agi->agi_newino),
 						 XFS_LOOKUP_EQ, &i);
 			if (error)
 				goto error_cur;
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs