summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2001-03-23 20:58:25 +0000
committermckusick <mckusick@FreeBSD.org>2001-03-23 20:58:25 +0000
commitc6fdb61aa7db6301e2d0f28a266a50d1cc91e7c7 (patch)
tree3f7cf016532b8a77111f1ef0a9f66c1cce1934a4 /sys
parente6b6652c8fcc96ba1f2211b0f1185567fbd8c9b6 (diff)
downloadFreeBSD-src-c6fdb61aa7db6301e2d0f28a266a50d1cc91e7c7.zip
FreeBSD-src-c6fdb61aa7db6301e2d0f28a266a50d1cc91e7c7.tar.gz
Check that background fsck operation is being done on a ufs filesystem.
Obtained from: Robert Watson <rwatson@FreeBSD.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 9166083..60441ad 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1799,6 +1799,8 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
if ((error = getvnode(curproc->p_fd, cmd.handle, &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
+ if (strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN))
+ return (EINVAL);
if (mp->mnt_flag & MNT_RDONLY)
return (EROFS);
ump = VFSTOUFS(mp);
OpenPOWER on IntegriCloud