From 282d0382acbe85e046e832147d25e175fabb436a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 9 Nov 2004 22:21:52 +0000 Subject: [PATCH] Detect root mount attempts on the flag, not on the NULL path. --- sys/fs/cd9660/cd9660_vfsops.c | 2 +- sys/fs/ntfs/ntfs_vfsops.c | 2 +- sys/isofs/cd9660/cd9660_vfsops.c | 2 +- sys/nfsclient/nfs_vfsops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index e998f617b7aa..9500695a572c 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -201,7 +201,7 @@ cd9660_omount(mp, path, data, td) struct iso_mnt *imp = 0; struct nameidata ndp; - if (path == NULL) /* We are doing the initial root mount */ + if (mp->mnt_flag & MNT_ROOTFS) return (iso_mountroot(mp, td)); if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)))) return (error); diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index 975fdea9f2f5..684fb8c18e10 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -114,7 +114,7 @@ ntfs_omount ( /* * Use NULL path to flag a root mount */ - if( path == NULL) { + if (mp->mnt_flag & MNT_ROOTFS) { /* *** * Mounting root filesystem diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index e998f617b7aa..9500695a572c 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -201,7 +201,7 @@ cd9660_omount(mp, path, data, td) struct iso_mnt *imp = 0; struct nameidata ndp; - if (path == NULL) /* We are doing the initial root mount */ + if (mp->mnt_flag & MNT_ROOTFS) return (iso_mountroot(mp, td)); if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)))) return (error); diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 6cbe85910fb6..bde4c23f4ce7 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -678,7 +678,7 @@ nfs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td) size_t len; u_char nfh[NFSX_V3FHMAX]; - if (path == NULL) + if (mp->mnt_flag & MNT_ROOTFS) return (nfs_mountroot(mp, td)); error = copyin(data, (caddr_t)&args, sizeof (struct nfs_args)); if (error)