[PATCH 08/41] Fix a bug in nullfs_mount()

François Tigeot ftigeot at wolfpond.org
Sun Aug 14 06:13:30 PDT 2011


All filesystems populate the name of their mount point at mount
time. nullfs did not.
---
 sys/vfs/nullfs/null_vfsops.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sys/vfs/nullfs/null_vfsops.c b/sys/vfs/nullfs/null_vfsops.c
index 520fd1c..eb6d5e9 100644
--- a/sys/vfs/nullfs/null_vfsops.c
+++ b/sys/vfs/nullfs/null_vfsops.c
@@ -194,6 +194,13 @@ nullfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
 	NULLFSDEBUG("nullfs_mount: lower %s, alias at %s\n",
 		mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntfromname);
 
+	/* nullfs_statfs doesn't populate f_mntonname */
+	bzero(mp->mnt_stat.f_mntonname, MNAMELEN);
+	if (path != NULL) {
+		(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1,
+			&size);
+	}
+
 	/*
 	 * Set NCALIASED so unmount won't complain about namecache refs
 	 * still existing.
-- 
1.7.5.4


--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0023-Populate-the-statfs-structure-associated-to-mount-po.patch"





More information about the Submit mailing list