Commit e68ed775 authored by Dave Chinner's avatar Dave Chinner
Browse files

xfs: fix use of agi_newino in finobt lookup

Sparse warns that we are passing the big-endian valueo f agi_newino
to the initial btree lookup function when trying to find a new
inode. This is wrong - we need to pass the host order value, not the
disk order value. This will adversely affect the next inode
allocated, but given that the free inode btree is usually much
smaller than the allocated inode btree it is much less likely to be
a performance issue if we start the search in the wrong place.
Signed-off-by: default avatarDave Chinner <>
Reviewed-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarDave Chinner <>
parent ab6978c2
......@@ -1076,8 +1076,8 @@ xfs_dialloc_ag_finobt_newino(
int i;
if (agi->agi_newino != cpu_to_be32(NULLAGINO)) {
error = xfs_inobt_lookup(cur, agi->agi_newino, XFS_LOOKUP_EQ,
error = xfs_inobt_lookup(cur, be32_to_cpu(agi->agi_newino),
if (error)
return error;
if (i == 1) {
......@@ -1085,7 +1085,6 @@ xfs_dialloc_ag_finobt_newino(
if (error)
return error;
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment