diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-12-04 18:04:11 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-12-15 17:29:32 -0800 |
commit | 851df07d9599471df909c4ff0e3cf33f4b9619f0 (patch) | |
tree | 390175cf6ee12df70340e9e1d23742882a01bce3 /fs/xfs/scrub/symlink.c | |
parent | e659750c94e5a1c7b9398396e47ee00749d8973e (diff) |
xfs: convert symlink repair to use swapextrepair-symlink-swapext_2021-12-15
Convert the symlink repair code to use extent swapping. This means we
can eliminate the problem of symlinks with crosslinked blocks.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/symlink.c')
-rw-r--r-- | fs/xfs/scrub/symlink.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c index 265bef07073b..86185c817acf 100644 --- a/fs/xfs/scrub/symlink.c +++ b/fs/xfs/scrub/symlink.c @@ -10,25 +10,33 @@ #include "xfs_trans_resv.h" #include "xfs_mount.h" #include "xfs_log_format.h" +#include "xfs_trans.h" #include "xfs_inode.h" #include "xfs_symlink.h" #include "xfs_symlink_remote.h" #include "scrub/scrub.h" #include "scrub/common.h" +#include "scrub/repair.h" /* Set us up to scrub a symbolic link. */ int xchk_setup_symlink( struct xfs_scrub *sc) { - uint resblks; + unsigned int resblks = 0; + int error; /* Allocate the buffer without the inode lock held. */ sc->buf = kvzalloc(XFS_SYMLINK_MAXLEN + 1, GFP_KERNEL); if (!sc->buf) return -ENOMEM; - resblks = xfs_symlink_blocks(sc->mp, XFS_SYMLINK_MAXLEN); + if (xchk_could_repair(sc)) { + error = xrep_setup_symlink(sc, &resblks); + if (error) + return error; + } + return xchk_setup_inode_contents(sc, resblks); } |