summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/symlink.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 10:45:55 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-09-17 18:54:52 -0700
commitc0d680ffb0b1f0f29f30bf986db407c7b310915b (patch)
tree5e7e51b403af61967b71e23e27f5b7e0cf93b431 /fs/xfs/scrub/symlink.c
parent40a6864f1951b06d5c2f64c539f7744f8094aa05 (diff)
xfs: repair damaged symlinksrepair-inodes_2021-09-17
Repair inconsistent symbolic link data. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/symlink.c')
-rw-r--r--fs/xfs/scrub/symlink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/scrub/symlink.c b/fs/xfs/scrub/symlink.c
index 599ee277bba2..37d60a52f67a 100644
--- a/fs/xfs/scrub/symlink.c
+++ b/fs/xfs/scrub/symlink.c
@@ -20,12 +20,15 @@ int
xchk_setup_symlink(
struct xfs_scrub *sc)
{
+ uint resblks;
+
/* Allocate the buffer without the inode lock held. */
sc->buf = kvzalloc(XFS_SYMLINK_MAXLEN + 1, GFP_KERNEL);
if (!sc->buf)
return -ENOMEM;
- return xchk_setup_inode_contents(sc, 0);
+ resblks = xfs_symlink_blocks(sc->mp, XFS_SYMLINK_MAXLEN);
+ return xchk_setup_inode_contents(sc, resblks);
}
/* Symbolic links. */