]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: load next_agino from the correct xfarray in xrep_iunlink_relink_prev
authorDarrick J. Wong <djwong@kernel.org>
Mon, 27 Jul 2026 05:25:19 +0000 (22:25 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 3 Aug 2026 08:20:43 +0000 (10:20 +0200)
LOLLM notices that xrep_iunlink_relink_prev has the comment "set the
forward pointer..." but then loads the value from the xfarray that
stores pointers to the previous inode in the unlinked list.  That's
wrong, so fix the variable access.

Cc: stable@vger.kernel.org # v6.10
Fixes: ab97f4b1c03075 ("xfs: repair AGI unlinked inode bucket lists")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/agheader_repair.c

index 39468b8fa9863d0d384d2c8598db5ba73204b437..5204eab09c64505d9a43e812ddeeb4f6d683e247 100644 (file)
@@ -1619,7 +1619,7 @@ xrep_iunlink_relink_prev(
                want_rele = true;
 
                /* Set the forward pointer since this just came off disk. */
-               error = xfarray_load(ragi->iunlink_prev, agino, &next_agino);
+               error = xfarray_load(ragi->iunlink_next, agino, &next_agino);
                if (error)
                        goto out_rele;