]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: convert xchk_inode_xref_set_corrupt to xchk_ip_xref_set_corrupt
authorChristoph Hellwig <hch@lst.de>
Fri, 15 May 2026 13:50:28 +0000 (15:50 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 9 Jun 2026 07:14:41 +0000 (09:14 +0200)
All xref corruption reports have the xfs_inode structure, so switch
the helper to work based on that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/common.c
fs/xfs/scrub/common.h
fs/xfs/scrub/dirtree.c
fs/xfs/scrub/inode.c
fs/xfs/scrub/nlinks.c
fs/xfs/scrub/rtbitmap.c
fs/xfs/scrub/rtsummary.c

index b271f4c4ef4367ec961e580ebb79ee8cb94e9ff0..f741ed9cbe2e70767902a6096c68bc5be986ea1e 100644 (file)
@@ -320,12 +320,12 @@ xchk_ino_set_corrupt(
 
 /* Record a corruption while cross-referencing with an inode. */
 void
-xchk_ino_xref_set_corrupt(
+xchk_ip_xref_set_corrupt(
        struct xfs_scrub        *sc,
-       xfs_ino_t               ino)
+       struct xfs_inode        *ip)
 {
        sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
-       trace_xchk_ino_error(sc, ino, __return_address);
+       trace_xchk_ino_error(sc, ip->i_ino, __return_address);
 }
 
 /* Record corruption in a block indexed by a file fork. */
index 0e23b125720f3fef32dc92e987d1cb8e13f57759..54ea7cdddf845c431e96a79619b1ca55b1cf732b 100644 (file)
@@ -43,8 +43,8 @@ void xchk_qcheck_set_corrupt(struct xfs_scrub *sc, unsigned int dqtype,
 
 void xchk_block_xref_set_corrupt(struct xfs_scrub *sc,
                struct xfs_buf *bp);
-void xchk_ino_xref_set_corrupt(struct xfs_scrub *sc,
-               xfs_ino_t ino);
+void xchk_ip_xref_set_corrupt(struct xfs_scrub *sc,
+               struct xfs_inode *ip);
 void xchk_fblock_xref_set_corrupt(struct xfs_scrub *sc,
                int whichfork, xfs_fileoff_t offset);
 
index 124b2379d5c4d56f5bcd0ab56b12c4f65d6e1462..51b37dfa28f07999134a81958c98282142886916 100644 (file)
@@ -954,7 +954,7 @@ xchk_dirtree(
                 * parent pointers are corrupt; this scan cannot be completed
                 * without full information.
                 */
-               xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+               xchk_ip_xref_set_corrupt(sc, sc->ip);
                error = 0;
                goto out_scanlock;
        }
@@ -984,7 +984,7 @@ xchk_dirtree(
                if (oc.bad || oc.good + oc.suspect != 1)
                        xchk_ip_set_corrupt(sc, sc->ip);
                if (oc.suspect)
-                       xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+                       xchk_ip_xref_set_corrupt(sc, sc->ip);
        }
 
 out_scanlock:
index 948d04dcba2a48edc0615b40e49421e0b46220d4..3f234e9c5afd478f96d8c6ffc833b25a94e03128 100644 (file)
@@ -710,17 +710,17 @@ xchk_inode_xref_bmap(
        if (!xchk_should_check_xref(sc, &error, NULL))
                return;
        if (nextents < xfs_dfork_data_extents(dip))
-               xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+               xchk_ip_xref_set_corrupt(sc, sc->ip);
 
        error = xchk_inode_count_blocks(sc, XFS_ATTR_FORK, &nextents, &acount);
        if (!xchk_should_check_xref(sc, &error, NULL))
                return;
        if (nextents != xfs_dfork_attr_extents(dip))
-               xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+               xchk_ip_xref_set_corrupt(sc, sc->ip);
 
        /* Check nblocks against the inode. */
        if (count + acount != be64_to_cpu(dip->di_nblocks))
-               xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
+               xchk_ip_xref_set_corrupt(sc, sc->ip);
 }
 
 /* Cross-reference with the other btrees. */
index 2a214802c77ced36201de3ea0ceff712ea94f57b..01ce6517a0360375b7f3b3527038f4486897a383 100644 (file)
@@ -740,7 +740,7 @@ xchk_nlinks_compare_inode(
                 * number of subdirectory entries in the directory.
                 */
                if (obs.children != obs.backrefs)
-                       xchk_ino_xref_set_corrupt(sc, ip->i_ino);
+                       xchk_ip_xref_set_corrupt(sc, ip);
        } else {
                /*
                 * Non-directories and unlinked directories should not have
index 10d4c11372d9c070cc1af0e30479577269e593b0..de3f22f310f7ebfb7eeb63b8797d8cf1c9b46d30 100644 (file)
@@ -284,7 +284,7 @@ xchk_xref_is_used_rt_space(
        if (xfs_has_zoned(sc->mp)) {
                if (!xfs_zone_rgbno_is_valid(rtg,
                                xfs_rtb_to_rgbno(sc->mp, rtbno) + len - 1))
-                       xchk_ino_xref_set_corrupt(sc, rtg_rmap(rtg)->i_ino);
+                       xchk_ip_xref_set_corrupt(sc, rtg_rmap(rtg));
                return;
        }
 
@@ -295,5 +295,5 @@ xchk_xref_is_used_rt_space(
        if (!xchk_should_check_xref(sc, &error, NULL))
                return;
        if (is_free)
-               xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino);
+               xchk_ip_xref_set_corrupt(sc, rtg_bitmap(rtg));
 }
index 18074c1ff166aeae50f9ce69016ffd524c6a7be3..78f72a0468870e2c5593ace805556c6a5fe726bf 100644 (file)
@@ -189,7 +189,7 @@ xchk_rtsum_record_free(
        rtlen = xfs_rtxlen_to_extlen(mp, rec->ar_extcount);
 
        if (!xfs_verify_rtbext(mp, rtbno, rtlen)) {
-               xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino);
+               xchk_ip_xref_set_corrupt(sc, rtg_bitmap(rtg));
                return -EFSCORRUPTED;
        }