DragonFly BSD
DragonFly submit List (threaded) for 2011-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: François Tigeot <ftigeot@xxxxxxxxxxxx>
Date: Sun, 14 Aug 2011 15:13:30 +0200

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"



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]