diff options
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); } |