]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: set the prev pointer when reinserting an inode on the unlinked list
authorDarrick J. Wong <djwong@kernel.org>
Mon, 27 Jul 2026 05:26:37 +0000 (22:26 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 3 Aug 2026 08:20:43 +0000 (10:20 +0200)
If we find a rogue free inode and decide to reinsert it into the
unlinked list, we need to set the prev pointer to NULLAGINO so that the
incore list gets updated.

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/agheader_repair.c

index 65b9a8befce99be4a0a00b16b84892475f5519c6..4f1f235349c5a311c26e1618dcef730c19e5e858 100644 (file)
@@ -1504,6 +1504,10 @@ xrep_iunlink_add_to_bucket(
        if (error)
                return error;
 
+       error = xrep_iunlink_store_prev(ragi, agino, NULLAGINO);
+       if (error)
+               return error;
+
        /* Remember the head inode's previous pointer. */
        if (current_head != NULLAGINO) {
                error = xrep_iunlink_store_prev(ragi, current_head, agino);