6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit f8d0d90f2e24b1f4a14796ae63cebfd820cadfcd upstream. LOLLM noticed that we fail to clear the SYMLINK_ZAPPED flag if an inline symlink checks out ok, even after a repair. Fix that. Cc: stable@vger.kernel.org # v6.8 Fixes: d9041681dd2f53 ("xfs: set inode sick state flags when we zap either ondisk fork") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/symlink.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) --- a/fs/xfs/scrub/symlink.c +++ b/fs/xfs/scrub/symlink.c @@ -70,21 +70,20 @@ xchk_symlink( return 0; } - /* Inline symlink? */ if (ifp->if_format == XFS_DINODE_FMT_LOCAL) { + /* Inline symlink? */ if (len > xfs_inode_data_fork_size(ip) || len > strnlen(ifp->if_data, xfs_inode_data_fork_size(ip))) xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); - return 0; + } else { + /* Remote symlink; must read the contents. */ + error = xfs_symlink_remote_read(sc->ip, sc->buf); + if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) + return error; + if (strnlen(sc->buf, XFS_SYMLINK_MAXLEN) < len) + xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); } - /* Remote symlink; must read the contents. */ - error = xfs_symlink_remote_read(sc->ip, sc->buf); - if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) - return error; - if (strnlen(sc->buf, XFS_SYMLINK_MAXLEN) < len) - xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); - /* If a remote symlink is clean, it is clearly not zapped. */ xchk_mark_healthy_if_clean(sc, XFS_SICK_INO_SYMLINK_ZAPPED); return 0;