]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: set XFS_SICK_INO_SYMLINK_ZAPPED explicitly when zapping a symlink
authorDarrick J. Wong <djwong@kernel.org>
Mon, 2 Dec 2024 18:57:28 +0000 (10:57 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 13 Dec 2024 01:45:09 +0000 (17:45 -0800)
If we need to reset a symlink target to the "durr it's busted" string,
then we clear the zapped flag as well.  However, this should be using
the provided helper so that we don't set the zapped state on an
otherwise ok symlink.

Cc: <stable@vger.kernel.org> # v6.10
Fixes: 2651923d8d8db0 ("xfs: online repair of symbolic links")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/symlink_repair.c

index d015a86ef460fb9145e335922fcd7a586452723b..953ce7be78dc2f9fc1436d581fbd04d748c32f74 100644 (file)
@@ -36,6 +36,7 @@
 #include "scrub/tempfile.h"
 #include "scrub/tempexch.h"
 #include "scrub/reap.h"
+#include "scrub/health.h"
 
 /*
  * Symbolic Link Repair
@@ -233,7 +234,7 @@ xrep_symlink_salvage(
         * target zapped flag.
         */
        if (buflen == 0) {
-               sc->sick_mask |= XFS_SICK_INO_SYMLINK_ZAPPED;
+               xchk_mark_healthy_if_clean(sc, XFS_SICK_INO_SYMLINK_ZAPPED);
                sprintf(target_buf, DUMMY_TARGET);
        }