DragonFly submit List (threaded) for 2005-02
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: getfsstat visibility patch
As extension of the original patch, this removes (with one exception)
all code from filesystems which deals with f_mntonname. Most debug
statements use f_mntfromname instead, which should be enough to
identify the filesystem. I didn't use cache_fullpath in the
shutdown path to avoid possible blocks, since cache_fullpath does
a local allocation. I changed cache_fullpath to work for pure kernel
threads.
Both getfsstat and fhstatfs check the visibility, the other stat calls
just have the (chroot) relative path handling.
I'm still thinking about how to best handle the remaining use in
cd9660fs, but I think using cache_fullpath doesn't hurt.
Matt, what do you think?
Joerg
Index: emulation/linux/i386/linprocfs/linprocfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c,v
retrieving revision 1.8
diff -u -r1.8 linprocfs_vfsops.c
--- emulation/linux/i386/linprocfs/linprocfs_vfsops.c 17 Dec 2004 00:18:05 -0000 1.8
+++ emulation/linux/i386/linprocfs/linprocfs_vfsops.c 2 Feb 2005 14:26:34 -0000
@@ -94,9 +94,6 @@
vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, linprocfs_vnodeop_entries);
- (void) copyinstr(path, (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
size = sizeof("linprocfs") - 1;
bcopy("linprocfs", mp->mnt_stat.f_mntfromname, size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
@@ -159,7 +156,6 @@
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
Index: kern/vfs_cache.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/kern/vfs_cache.c,v
retrieving revision 1.49
diff -u -r1.49 vfs_cache.c
--- kern/vfs_cache.c 1 Feb 2005 14:43:44 -0000 1.49
+++ kern/vfs_cache.c 2 Feb 2005 14:54:29 -0000
@@ -379,7 +379,7 @@
didwarn = 1;
printf("[diagnostic] cache_lock: blocked on %p", ncp);
if ((ncp->nc_flag & NCF_MOUNTPT) && ncp->nc_mount)
- printf(" [MOUNTPT %s]\n", ncp->nc_mount->mnt_stat.f_mntonname);
+ printf(" [MOUNTFROM %s]\n", ncp->nc_mount->mnt_stat.f_mntfromname);
else
printf(" \"%*.*s\"\n",
ncp->nc_nlen, ncp->nc_nlen,
@@ -1763,16 +1763,19 @@
{
char *bp, *buf;
int i, slash_prefixed;
- struct filedesc *fdp;
+ struct namecache *fd_nrdir;
numfullpathcalls--;
buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
bp = buf + MAXPATHLEN - 1;
*bp = '\0';
- fdp = p->p_fd;
+ if (p != NULL)
+ fd_nrdir = p->p_fd->fd_nrdir;
+ else
+ fd_nrdir = NULL;
slash_prefixed = 0;
- while (ncp && ncp != fdp->fd_nrdir && (ncp->nc_flag & NCF_ROOT) == 0) {
+ while (ncp && ncp != fd_nrdir && (ncp->nc_flag & NCF_ROOT) == 0) {
if (ncp->nc_flag & NCF_MOUNTPT) {
if (ncp->nc_mount == NULL) {
free(buf, M_TEMP);
@@ -1803,7 +1806,7 @@
free(buf, M_TEMP);
return(ENOENT);
}
- if ((ncp->nc_flag & NCF_ROOT) && ncp != fdp->fd_nrdir) {
+ if (p != NULL && (ncp->nc_flag & NCF_ROOT) && ncp != fd_nrdir) {
bp = buf + MAXPATHLEN - 1;
*bp = '\0';
slash_prefixed = 0;
Index: kern/vfs_mount.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/kern/vfs_mount.c,v
retrieving revision 1.4
diff -u -r1.4 vfs_mount.c
--- kern/vfs_mount.c 29 Dec 2004 02:40:02 -0000 1.4
+++ kern/vfs_mount.c 2 Feb 2005 14:32:27 -0000
@@ -272,9 +272,6 @@
mp->mnt_stat.f_type = vfsp->vfc_typenum;
mp->mnt_flag |= vfsp->vfc_flags & MNT_VISFLAGMASK;
strncpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN);
- mp->mnt_stat.f_mntonname[0] = '/';
- mp->mnt_stat.f_mntonname[1] = 0;
- (void) copystr(devname, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, 0);
*mpp = mp;
return (0);
}
Index: kern/vfs_subr.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/kern/vfs_subr.c,v
retrieving revision 1.50
diff -u -r1.50 vfs_subr.c
--- kern/vfs_subr.c 17 Dec 2004 00:18:07 -0000 1.50
+++ kern/vfs_subr.c 2 Feb 2005 14:59:10 -0000
@@ -1319,9 +1319,18 @@
mp = TAILQ_LAST(&mountlist, mntlist);
error = dounmount(mp, MNT_FORCE, td);
if (error) {
+ char *fullpath, *freepath;
+ int error2;
TAILQ_REMOVE(&mountlist, mp, mnt_list);
- printf("unmount of %s failed (",
- mp->mnt_stat.f_mntonname);
+ error2 = cache_fullpath(NULL, mp->mnt_ncp, &fullpath,
+ &freepath);
+ if (error2) {
+ fullpath = "unresolvable mount point";
+ freepath = NULL;
+ }
+ printf("unmount of %s failed (", fullpath);
+ if (freepath)
+ free(freepath, M_TEMP);
if (error == EBUSY)
printf("BUSY)\n");
else
Index: kern/vfs_syscalls.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.57
diff -u -r1.57 vfs_syscalls.c
--- kern/vfs_syscalls.c 1 Feb 2005 21:52:11 -0000 1.57
+++ kern/vfs_syscalls.c 2 Feb 2005 15:23:08 -0000
@@ -76,6 +76,7 @@
static int checkvp_chdir (struct vnode *vn, struct thread *td);
static void checkdirs (struct vnode *olddp, struct namecache *ncp);
static int chroot_refuse_vdir_fds (struct filedesc *fdp);
+static int chroot_visible_mnt(struct mount *mp, struct proc *p);
static int getutimes (const struct timeval *, struct timespec *);
static int setfown (struct vnode *, uid_t, gid_t);
static int setfmode (struct vnode *, int);
@@ -806,8 +807,10 @@
kern_statfs(struct nlookupdata *nd, struct statfs *buf)
{
struct thread *td = curthread;
+ struct proc *p = td->td_proc;
struct mount *mp;
struct statfs *sp;
+ char *fullpath, *freepath;
int error;
if ((error = nlookup(nd)) != 0)
@@ -816,6 +819,14 @@
sp = &mp->mnt_stat;
if ((error = VFS_STATFS(mp, sp, td)) != 0)
return (error);
+
+ error = cache_fullpath(p, mp->mnt_ncp, &fullpath, &freepath);
+ if (error)
+ return(error);
+ bzero(sp->f_mntonname, sizeof(sp->f_mntonname));
+ strlcpy(sp->f_mntonname, fullpath, sizeof(sp->f_mntonname));
+ free(freepath, M_TEMP);
+
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
bcopy(sp, buf, sizeof(*buf));
/* Only root should have access to the fsid's. */
@@ -853,6 +864,7 @@
struct file *fp;
struct mount *mp;
struct statfs *sp;
+ char *fullpath, *freepath;
int error;
KKASSERT(p);
@@ -866,8 +878,17 @@
error = VFS_STATFS(mp, sp, td);
if (error)
return (error);
+
+ error = cache_fullpath(p, mp->mnt_ncp, &fullpath, &freepath);
+ if (error)
+ return(error);
+ bzero(sp->f_mntonname, sizeof(sp->f_mntonname));
+ strlcpy(sp->f_mntonname, fullpath, sizeof(sp->f_mntonname));
+ free(freepath, M_TEMP);
+
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
bcopy(sp, buf, sizeof(*buf));
+
/* Only root should have access to the fsid's. */
if (suser(td))
buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0;
@@ -902,10 +923,18 @@
getfsstat(struct getfsstat_args *uap)
{
struct thread *td = curthread;
+ struct proc *p = td->td_proc;
struct mount *mp, *nmp;
struct statfs *sp, *sfsp;
lwkt_tokref ilock;
long count, maxcount, error;
+ int is_chrooted;
+ char *freepath, *fullpath;
+
+ if (p != NULL && (p->p_fd->fd_nrdir->nc_flag & NCF_ROOT) == 0)
+ is_chrooted = 1;
+ else
+ is_chrooted = 0;
maxcount = uap->bufsize / sizeof(struct statfs);
sfsp = uap->buf;
@@ -917,6 +946,12 @@
continue;
}
if (sfsp && count < maxcount) {
+ if (is_chrooted && !chroot_visible_mnt(mp, p)) {
+ lwkt_gettokref(&ilock);
+ nmp = TAILQ_NEXT(mp, mnt_list);
+ vfs_unbusy(mp, td);
+ continue;
+ }
sp = &mp->mnt_stat;
/*
* If MNT_NOWAIT or MNT_LAZY is specified, do not
@@ -932,6 +967,15 @@
continue;
}
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
+
+ error = cache_fullpath(p, mp->mnt_ncp, &fullpath, &freepath);
+ if (error)
+ return(error);
+ bzero(sp->f_mntonname, sizeof(sp->f_mntonname));
+ strlcpy(sp->f_mntonname, fullpath,
+ sizeof(sp->f_mntonname));
+ free(freepath, M_TEMP);
+
error = copyout(sp, sfsp, sizeof(*sp));
if (error) {
vfs_unbusy(mp, td);
@@ -3278,10 +3322,12 @@
fhstatfs(struct fhstatfs_args *uap)
{
struct thread *td = curthread;
+ struct proc *p = td->td_proc;
struct statfs *sp;
struct mount *mp;
struct vnode *vp;
struct statfs sb;
+ char *fullpath, *freepath;
fhandle_t fh;
int error;
@@ -3296,6 +3342,11 @@
if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL)
return (ESTALE);
+
+ if (p != NULL && (p->p_fd->fd_nrdir->nc_flag & NCF_ROOT) == 0 &&
+ !chroot_visible_mnt(mp, p))
+ return (ESTALE);
+
if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp)))
return (error);
mp = vp->v_mount;
@@ -3303,6 +3354,14 @@
vput(vp);
if ((error = VFS_STATFS(mp, sp, td)) != 0)
return (error);
+
+ error = cache_fullpath(p, mp->mnt_ncp, &fullpath, &freepath);
+ if (error)
+ return(error);
+ bzero(sp->f_mntonname, sizeof(sp->f_mntonname));
+ strlcpy(sp->f_mntonname, fullpath, sizeof(sp->f_mntonname));
+ free(freepath, M_TEMP);
+
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
if (suser(td)) {
bcopy(sp, &sb, sizeof(sb));
@@ -3564,3 +3623,34 @@
}
}
#endif
+
+static int
+chroot_visible_mnt(struct mount *mp, struct proc *p)
+{
+ struct namecache *ncp;
+ /*
+ * First check if this file system is below
+ * the chroot path.
+ */
+ ncp = mp->mnt_ncp;
+ while (ncp != NULL && ncp != p->p_fd->fd_nrdir)
+ ncp = ncp->nc_parent;
+ if (ncp == NULL) {
+ /*
+ * This is not below the chroot path.
+ *
+ * Check if the chroot path is on the same filesystem,
+ * by determing if we have to cross a mount point
+ * before reaching mp->mnt_ncp.
+ */
+ ncp = p->p_fd->fd_nrdir;
+ while (ncp != NULL && ncp != mp->mnt_ncp) {
+ if (ncp->nc_flag & NCF_MOUNTPT) {
+ ncp = NULL;
+ break;
+ }
+ ncp = ncp->nc_parent;
+ }
+ }
+ return(ncp != NULL);
+}
Index: vfs/coda/coda_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/coda/coda_vfsops.c,v
retrieving revision 1.18
diff -u -r1.18 coda_vfsops.c
--- vfs/coda/coda_vfsops.c 12 Nov 2004 00:09:28 -0000 1.18
+++ vfs/coda/coda_vfsops.c 2 Feb 2005 14:32:44 -0000
@@ -388,7 +388,6 @@
sbp->f_files = NB_SFS_SIZ;
sbp->f_ffree = NB_SFS_SIZ;
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
- snprintf(sbp->f_mntonname, sizeof(sbp->f_mntonname), "/coda");
snprintf(sbp->f_mntfromname, sizeof(sbp->f_mntfromname), "CODA");
/* MARK_INT_SAT(CODA_STATFS_STATS); */
return(0);
Index: vfs/fdesc/fdesc_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/fdesc/fdesc_vfsops.c,v
retrieving revision 1.11
diff -u -r1.11 fdesc_vfsops.c
--- vfs/fdesc/fdesc_vfsops.c 17 Dec 2004 00:18:18 -0000 1.11
+++ vfs/fdesc/fdesc_vfsops.c 2 Feb 2005 14:33:07 -0000
@@ -104,8 +104,6 @@
mp->mnt_data = (qaddr_t) fmp;
vfs_getnewfsid(mp);
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
bcopy("fdesc", mp->mnt_stat.f_mntfromname, sizeof("fdesc"));
(void)fdesc_statfs(mp, &mp->mnt_stat, td);
@@ -201,7 +199,6 @@
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return (0);
Index: vfs/gnu/ext2fs/ext2_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v
retrieving revision 1.25
diff -u -r1.25 ext2_vfsops.c
--- vfs/gnu/ext2fs/ext2_vfsops.c 29 Dec 2004 02:42:14 -0000 1.25
+++ vfs/gnu/ext2fs/ext2_vfsops.c 2 Feb 2005 14:33:30 -0000
@@ -262,7 +262,6 @@
fs = ump->um_e2fs;
copyinstr(path, fs->fs_fsmnt, sizeof(fs->fs_fsmnt) - 1, &size);
bzero(fs->fs_fsmnt + size, sizeof(fs->fs_fsmnt) - size);
- bcopy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
ext2_statfs(mp, &mp->mnt_stat, td);
@@ -842,8 +841,6 @@
sbp->f_ffree = es->s_free_inodes_count;
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&sbp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&sbp->f_mntfromname[0], MNAMELEN);
}
Index: vfs/hpfs/hpfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/hpfs/hpfs_vfsops.c,v
retrieving revision 1.25
diff -u -r1.25 hpfs_vfsops.c
--- vfs/hpfs/hpfs_vfsops.c 29 Dec 2004 02:42:15 -0000 1.25
+++ vfs/hpfs/hpfs_vfsops.c 2 Feb 2005 14:34:24 -0000
@@ -229,19 +229,6 @@
********************
*/
- /*
- * Since this is a new mount, we want the names for
- * the device and the mount point copied in. If an
- * error occurs, the mountpoint is discarded by the
- * upper level code.
- */
- /* Save "last mounted on" info for mount point (NULL pad)*/
- copyinstr( path, /* mount point*/
- mp->mnt_stat.f_mntonname, /* save area*/
- MNAMELEN - 1, /* max size*/
- &size); /* real size*/
- bzero( mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
/* Save "mounted from" info for mount point (NULL pad)*/
copyinstr( args.fspec, /* device name*/
mp->mnt_stat.f_mntfromname, /* save area*/
@@ -254,8 +241,8 @@
goto error_2;
/*
- * Initialize FS stat information in mount struct; uses both
- * mp->mnt_stat.f_mntonname and mp->mnt_stat.f_mntfromname
+ * Initialize FS stat information in mount struct; uses
+ * mp->mnt_stat.f_mntfromname.
*
* This code is common to root and non-root mounts
*/
@@ -499,8 +486,6 @@
sbp->f_ffree = 0;
sbp->f_files = 0;
if (sbp != &mp->mnt_stat) {
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&sbp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&sbp->f_mntfromname[0], MNAMELEN);
}
Index: vfs/isofs/cd9660/cd9660_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v
retrieving revision 1.24
diff -u -r1.24 cd9660_vfsops.c
--- vfs/isofs/cd9660/cd9660_vfsops.c 17 Dec 2004 00:18:23 -0000 1.24
+++ vfs/isofs/cd9660/cd9660_vfsops.c 2 Feb 2005 14:34:59 -0000
@@ -257,8 +257,6 @@
return error;
}
imp = VFSTOISOFS(mp);
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
@@ -603,7 +601,6 @@
sbp->f_ffree = 0; /* free file nodes */
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return 0;
Index: vfs/mfs/mfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/mfs/mfs_vfsops.c,v
retrieving revision 1.20
diff -u -r1.20 mfs_vfsops.c
--- vfs/mfs/mfs_vfsops.c 17 Dec 2004 00:18:25 -0000 1.20
+++ vfs/mfs/mfs_vfsops.c 2 Feb 2005 14:36:12 -0000
@@ -314,19 +314,6 @@
mfsp->mfs_active = 1;
bufq_init(&mfsp->buf_queue);
- /*
- * Since this is a new mount, we want the names for
- * the device and the mount point copied in. If an
- * error occurs, the mountpoint is discarded by the
- * upper level code.
- */
- /* Save "last mounted on" info for mount point (NULL pad)*/
- copyinstr( path, /* mount point*/
- mp->mnt_stat.f_mntonname, /* save area*/
- MNAMELEN - 1, /* max size*/
- &size); /* real size*/
- bzero( mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
/* Save "mounted from" info for mount point (NULL pad)*/
copyinstr( args.fspec, /* device name*/
mp->mnt_stat.f_mntfromname, /* save area*/
@@ -341,8 +328,8 @@
}
/*
- * Initialize FS stat information in mount struct; uses both
- * mp->mnt_stat.f_mntonname and mp->mnt_stat.f_mntfromname
+ * Initialize FS stat information in mount struct; uses
+ * mp->mnt_stat.f_mntfromname.
*
* This code is common to root and non-root mounts
*/
Index: vfs/msdosfs/msdosfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/msdosfs/msdosfs_vfsops.c,v
retrieving revision 1.23
diff -u -r1.23 msdosfs_vfsops.c
--- vfs/msdosfs/msdosfs_vfsops.c 29 Dec 2004 02:42:16 -0000 1.23
+++ vfs/msdosfs/msdosfs_vfsops.c 2 Feb 2005 14:36:27 -0000
@@ -287,8 +287,6 @@
return error;
}
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
@@ -767,7 +765,6 @@
sbp->f_ffree = 0; /* what to put in here? */
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
Index: vfs/nfs/nfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/nfs/nfs_vfsops.c,v
retrieving revision 1.23
diff -u -r1.23 nfs_vfsops.c
--- vfs/nfs/nfs_vfsops.c 17 Dec 2004 00:18:28 -0000 1.23
+++ vfs/nfs/nfs_vfsops.c 2 Feb 2005 14:38:23 -0000
@@ -345,7 +345,6 @@
}
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
m_freem(mrep);
@@ -625,7 +624,6 @@
FREE(nam, M_SONAME);
return (error);
}
- (void) copystr(which, mp->mnt_stat.f_mntonname, MNAMELEN - 1, 0);
*mpp = mp;
return (0);
}
@@ -928,7 +926,6 @@
nmp->nm_fhsize = argp->fhsize;
bcopy((caddr_t)argp->fh, (caddr_t)nmp->nm_fh, argp->fhsize);
bcopy(hst, mp->mnt_stat.f_mntfromname, MNAMELEN);
- bcopy(pth, mp->mnt_stat.f_mntonname, MNAMELEN);
nmp->nm_nam = nam;
/* Set up the sockets and per-host congestion */
nmp->nm_sotype = argp->sotype;
Index: vfs/ntfs/ntfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/ntfs/ntfs_vfsops.c,v
retrieving revision 1.25
diff -u -r1.25 ntfs_vfsops.c
--- vfs/ntfs/ntfs_vfsops.c 17 Dec 2004 00:18:29 -0000 1.25
+++ vfs/ntfs/ntfs_vfsops.c 2 Feb 2005 14:40:00 -0000
@@ -355,19 +355,6 @@
********************
*/
- /*
- * Since this is a new mount, we want the names for
- * the device and the mount point copied in. If an
- * error occurs, the mountpoint is discarded by the
- * upper level code.
- */
- /* Save "last mounted on" info for mount point (NULL pad)*/
- copyinstr( path, /* mount point*/
- mp->mnt_stat.f_mntonname, /* save area*/
- MNAMELEN - 1, /* max size*/
- &size); /* real size*/
- bzero( mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
/* Save "mounted from" info for mount point (NULL pad)*/
copyinstr( args.fspec, /* device name*/
mp->mnt_stat.f_mntfromname, /* save area*/
@@ -385,8 +372,8 @@
dostatfs:
#endif
/*
- * Initialize FS stat information in mount struct; uses both
- * mp->mnt_stat.f_mntonname and mp->mnt_stat.f_mntfromname
+ * Initialize FS stat information in mount struct; uses
+ * mp->mnt_stat.f_mntfromname.
*
* This code is common to root and non-root mounts
*/
@@ -789,8 +776,6 @@
sbp->f_files = mftallocated / ntfs_bntob(ntmp->ntm_bpmftrec) +
sbp->f_ffree;
if (sbp != &mp->mnt_stat) {
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&sbp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&sbp->f_mntfromname[0], MNAMELEN);
}
Index: vfs/nullfs/null_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/nullfs/null_vfsops.c,v
retrieving revision 1.15
diff -u -r1.15 null_vfsops.c
--- vfs/nullfs/null_vfsops.c 17 Dec 2004 00:18:30 -0000 1.15
+++ vfs/nullfs/null_vfsops.c 2 Feb 2005 14:50:21 -0000
@@ -190,14 +190,12 @@
mp->mnt_data = (qaddr_t) xmp;
vfs_getnewfsid(mp);
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
(void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
(void)nullfs_statfs(mp, &mp->mnt_stat, td);
NULLFSDEBUG("nullfs_mount: lower %s, alias at %s\n",
- mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname);
+ mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntfromname);
return (0);
}
@@ -305,7 +303,6 @@
sbp->f_ffree = mstat.f_ffree;
if (sbp != &mp->mnt_stat) {
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return (0);
Index: vfs/nwfs/nwfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/nwfs/nwfs_vfsops.c,v
retrieving revision 1.14
diff -u -r1.14 nwfs_vfsops.c
--- vfs/nwfs/nwfs_vfsops.c 17 Dec 2004 00:18:32 -0000 1.14
+++ vfs/nwfs/nwfs_vfsops.c 2 Feb 2005 14:42:11 -0000
@@ -201,8 +201,6 @@
nmp->m.dir_mode = (nmp->m.dir_mode &
(S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR;
if ((error = nwfs_initnls(nmp)) != 0) goto bad;
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
pc = mp->mnt_stat.f_mntfromname;
pe = pc+sizeof(mp->mnt_stat.f_mntfromname);
bzero(pc, MNAMELEN);
@@ -463,7 +461,6 @@
sbp->f_fsid = mp->mnt_stat.f_fsid; /* file system id */
sbp->f_owner = mp->mnt_stat.f_owner; /* user that mounted the filesystem */
sbp->f_type = mp->mnt_vfc->vfc_typenum; /* type of filesystem */
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
Index: vfs/portal/portal_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/portal/portal_vfsops.c,v
retrieving revision 1.14
diff -u -r1.14 portal_vfsops.c
--- vfs/portal/portal_vfsops.c 17 Dec 2004 00:18:33 -0000 1.14
+++ vfs/portal/portal_vfsops.c 2 Feb 2005 14:42:23 -0000
@@ -135,8 +135,6 @@
mp->mnt_data = (qaddr_t) fmp;
vfs_getnewfsid(mp);
- (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
(void)copyinstr(args.pa_config,
mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
@@ -226,7 +224,6 @@
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return (0);
Index: vfs/procfs/procfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/procfs/procfs_vfsops.c,v
retrieving revision 1.10
diff -u -r1.10 procfs_vfsops.c
--- vfs/procfs/procfs_vfsops.c 17 Dec 2004 00:18:34 -0000 1.10
+++ vfs/procfs/procfs_vfsops.c 2 Feb 2005 14:42:31 -0000
@@ -85,9 +85,6 @@
mp->mnt_data = 0;
vfs_getnewfsid(mp);
- (void) copyinstr(path, (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
size = sizeof("procfs") - 1;
bcopy("procfs", mp->mnt_stat.f_mntfromname, size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
@@ -145,7 +142,6 @@
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
Index: vfs/smbfs/smbfs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/smbfs/smbfs_vfsops.c,v
retrieving revision 1.16
diff -u -r1.16 smbfs_vfsops.c
--- vfs/smbfs/smbfs_vfsops.c 17 Dec 2004 00:18:35 -0000 1.16
+++ vfs/smbfs/smbfs_vfsops.c 2 Feb 2005 14:43:34 -0000
@@ -200,10 +200,6 @@
(S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR;
/* simple_lock_init(&smp->sm_npslock);*/
- error = copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- if (error)
- goto bad;
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
pc = mp->mnt_stat.f_mntfromname;
pe = pc + sizeof(mp->mnt_stat.f_mntfromname);
bzero(pc, MNAMELEN);
@@ -414,7 +410,6 @@
sbp->f_fsid = mp->mnt_stat.f_fsid; /* file system id */
sbp->f_owner = mp->mnt_stat.f_owner; /* user that mounted the filesystem */
sbp->f_type = mp->mnt_vfc->vfc_typenum; /* type of filesystem */
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
Index: vfs/udf/udf_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/udf/udf_vfsops.c,v
retrieving revision 1.11
diff -u -r1.11 udf_vfsops.c
--- vfs/udf/udf_vfsops.c 17 Dec 2004 00:18:36 -0000 1.11
+++ vfs/udf/udf_vfsops.c 2 Feb 2005 14:43:48 -0000
@@ -196,8 +196,6 @@
imp->im_flags = args.flags;
- copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
udf_statfs(mp, &mp->mnt_stat, td);
@@ -475,7 +473,6 @@
sbp->f_ffree = 0;
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
Index: vfs/ufs/ffs_softdep.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/ufs/ffs_softdep.c,v
retrieving revision 1.20
diff -u -r1.20 ffs_softdep.c
--- vfs/ufs/ffs_softdep.c 9 Nov 2004 04:41:47 -0000 1.20
+++ vfs/ufs/ffs_softdep.c 2 Feb 2005 14:49:01 -0000
@@ -4935,7 +4935,7 @@
if ((bp->b_flags & B_ERROR) == 0)
panic("softdep_deallocate_dependencies: dangling deps");
- softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, bp->b_error);
+ softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntfromname, bp->b_error);
panic("softdep_deallocate_dependencies: unrecovered I/O error");
}
Index: vfs/ufs/ffs_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/ufs/ffs_vfsops.c,v
retrieving revision 1.29
diff -u -r1.29 ffs_vfsops.c
--- vfs/ufs/ffs_vfsops.c 17 Dec 2004 00:18:44 -0000 1.29
+++ vfs/ufs/ffs_vfsops.c 2 Feb 2005 14:45:24 -0000
@@ -352,19 +352,6 @@
********************
*/
- /*
- * Since this is a new mount, we want the names for
- * the device and the mount point copied in. If an
- * error occurs, the mountpoint is discarded by the
- * upper level code.
- */
- /* Save "last mounted on" info for mount point (NULL pad)*/
- copyinstr( path, /* mount point*/
- mp->mnt_stat.f_mntonname, /* save area*/
- MNAMELEN - 1, /* max size*/
- &size); /* real size*/
- bzero( mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
/* Save "mounted from" info for mount point (NULL pad)*/
copyinstr( args.fspec, /* device name*/
mp->mnt_stat.f_mntfromname, /* save area*/
@@ -380,8 +367,8 @@
dostatfs:
/*
- * Initialize FS stat information in mount struct; uses both
- * mp->mnt_stat.f_mntonname and mp->mnt_stat.f_mntfromname
+ * Initialize FS stat information in mount struct; uses
+ * mp->mnt_stat.f_mntfromname.
*
* This code is common to root and non-root mounts
*/
@@ -754,15 +741,6 @@
dev->si_mountpoint = mp;
ffs_oldfscompat(fs);
- /*
- * Set FS local "last mounted on" information (NULL pad)
- */
- copystr( mp->mnt_stat.f_mntonname, /* mount point*/
- fs->fs_fsmnt, /* copy area*/
- sizeof(fs->fs_fsmnt) - 1, /* max size*/
- &strsize); /* real size*/
- bzero( fs->fs_fsmnt + strsize, sizeof(fs->fs_fsmnt) - strsize);
-
if( mp->mnt_flag & MNT_ROOTFS) {
/*
* Root mount; update timestamp in mount structure.
@@ -948,8 +926,6 @@
sbp->f_ffree = fs->fs_cstotal.cs_nifree;
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&sbp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
(caddr_t)&sbp->f_mntfromname[0], MNAMELEN);
}
Index: vfs/ufs/ufs_lookup.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/ufs/ufs_lookup.c,v
retrieving revision 1.16
diff -u -r1.16 ufs_lookup.c
--- vfs/ufs/ufs_lookup.c 12 Nov 2004 00:09:52 -0000 1.16
+++ vfs/ufs/ufs_lookup.c 2 Feb 2005 14:49:31 -0000
@@ -604,7 +604,7 @@
mp = ITOV(ip)->v_mount;
(void)printf("%s: bad dir ino %lu at offset %ld: %s\n",
- mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how);
+ mp->mnt_stat.f_mntfromname, (u_long)ip->i_number, (long)offset, how);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
panic("ufs_dirbad: bad dir");
}
Index: vfs/ufs/ufs_quota.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/ufs/ufs_quota.c,v
retrieving revision 1.17
diff -u -r1.17 ufs_quota.c
--- vfs/ufs/ufs_quota.c 12 Nov 2004 00:09:52 -0000 1.17
+++ vfs/ufs/ufs_quota.c 2 Feb 2005 14:50:15 -0000
@@ -187,7 +187,7 @@
if ((dq->dq_flags & DQ_BLKS) == 0 &&
ip->i_uid == cred->cr_uid) {
uprintf("\n%s: write failed, %s disk limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type]);
dq->dq_flags |= DQ_BLKS;
}
@@ -203,7 +203,7 @@
VFSTOUFS(ITOV(ip)->v_mount)->um_btime[type];
if (ip->i_uid == cred->cr_uid)
uprintf("\n%s: warning, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type], "disk quota exceeded");
return (0);
}
@@ -211,7 +211,7 @@
if ((dq->dq_flags & DQ_BLKS) == 0 &&
ip->i_uid == cred->cr_uid) {
uprintf("\n%s: write failed, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type],
"disk quota exceeded for too long");
dq->dq_flags |= DQ_BLKS;
@@ -300,7 +300,7 @@
if ((dq->dq_flags & DQ_INODS) == 0 &&
ip->i_uid == cred->cr_uid) {
uprintf("\n%s: write failed, %s inode limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type]);
dq->dq_flags |= DQ_INODS;
}
@@ -316,7 +316,7 @@
VFSTOUFS(ITOV(ip)->v_mount)->um_itime[type];
if (ip->i_uid == cred->cr_uid)
uprintf("\n%s: warning, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type], "inode quota exceeded");
return (0);
}
@@ -324,7 +324,7 @@
if ((dq->dq_flags & DQ_INODS) == 0 &&
ip->i_uid == cred->cr_uid) {
uprintf("\n%s: write failed, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOV(ip)->v_mount->mnt_stat.f_mntfromname,
quotatypes[type],
"inode quota exceeded for too long");
dq->dq_flags |= DQ_INODS;
Index: vfs/umapfs/umap_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/umapfs/umap_vfsops.c,v
retrieving revision 1.15
diff -u -r1.15 umap_vfsops.c
--- vfs/umapfs/umap_vfsops.c 17 Dec 2004 00:18:46 -0000 1.15
+++ vfs/umapfs/umap_vfsops.c 2 Feb 2005 14:47:50 -0000
@@ -229,16 +229,10 @@
mp->mnt_data = (qaddr_t) amp;
vfs_getnewfsid(mp);
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
(void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
(void)umapfs_statfs(mp, &mp->mnt_stat, td);
-#ifdef DEBUG
- printf("umapfs_mount: lower %s, alias at %s\n",
- mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname);
-#endif
return (0);
}
@@ -352,7 +346,6 @@
sbp->f_ffree = mstat.f_ffree;
if (sbp != &mp->mnt_stat) {
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return (0);
Index: vfs/union/union_vfsops.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/vfs/union/union_vfsops.c,v
retrieving revision 1.18
diff -u -r1.18 union_vfsops.c
--- vfs/union/union_vfsops.c 17 Dec 2004 00:18:47 -0000 1.18
+++ vfs/union/union_vfsops.c 2 Feb 2005 14:48:03 -0000
@@ -249,9 +249,6 @@
mp->mnt_data = (qaddr_t) um;
vfs_getnewfsid(mp);
- (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
-
switch (um->um_op) {
case UNMNT_ABOVE:
cp = "<above>:";
@@ -276,8 +273,6 @@
(void)union_statfs(mp, &mp->mnt_stat, td);
- UDEBUG(("union_mount: from %s, on %s\n",
- mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname));
return (0);
bad:
@@ -446,7 +441,6 @@
if (sbp != &mp->mnt_stat) {
sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
return (0);
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]