summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-11-13 13:04:31 +0000
committerphk <phk@FreeBSD.org>2004-11-13 13:04:31 +0000
commit0eb6213e4dd08c12836ee7748958a2e5301d2c3a (patch)
tree0bc79c993a1ab7f1e3531b7d2f140da406751f62 /sys/ufs
parent216166ee0de39b10ba8e60f4115d65e1251ff29f (diff)
downloadFreeBSD-src-0eb6213e4dd08c12836ee7748958a2e5301d2c3a.zip
FreeBSD-src-0eb6213e4dd08c12836ee7748958a2e5301d2c3a.tar.gz
Be prepared to accept NULL mountargs as part of root-mounting.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 5d1e2b2..9d7a605 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -181,10 +181,15 @@ ffs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
}
/*
- * Mounting non-root filesystem or updating a filesystem
+ * Get mount options, if any.
*/
- if ((error = copyin(data, (caddr_t)&args, sizeof(struct ufs_args)))!= 0)
- return (error);
+ if (data != NULL) {
+ error = copyin(data, (caddr_t)&args, sizeof args);
+ if (error)
+ return (error);
+ } else {
+ memset(&args, 0, sizeof args);
+ }
/*
* If updating, check whether changing from read-only to
@@ -392,7 +397,7 @@ ffs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
* Save "mounted from" device name info for mount point (NULL pad).
*/
copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size);
- bzero( mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
+ bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
return (0);
}
@@ -574,7 +579,6 @@ ffs_mountfs(devvp, mp, td)
dev = devvp->v_rdev;
cred = td ? td->td_ucred : NOCRED;
-
vfs_object_create(devvp, td, td->td_ucred);
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
#if 0
OpenPOWER on IntegriCloud