Date: Thu, 21 Nov 2013 09:40:28 -0800 From: Doug Ambrisko <ambrisko@ambrisko.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-hackers@freebsd.org, Dirk Engling <erdgeist@erdgeist.org>, Jase Thew <jase@freebsd.org>, mdf@freebsd.org Subject: Re: Re: Fix MNAMELEN or reimplement struct statfs Message-ID: <20131121174028.GA80520@ambrisko.com> In-Reply-To: <20131120075531.GE59496@kib.kiev.ua> References: <51B3B59B.8050903@erdgeist.org> <CAMBSHm8GMWffuuEcSpuNu26Mv4N2yAa2iEdw5koiXx0w30zPRQ@mail.gmail.com> <201306101152.17966.jhb@freebsd.org> <52854161.6080104@FreeBSD.org> <20131115010854.GA76106@ambrisko.com> <20131116183129.GD59496@kib.kiev.ua> <20131118190142.GA28210@ambrisko.com> <20131119074922.GY59496@kib.kiev.ua> <20131119174216.GA80753@ambrisko.com> <20131120075531.GE59496@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 20, 2013 at 09:55:31AM +0200, Konstantin Belousov wrote: | On Tue, Nov 19, 2013 at 09:42:16AM -0800, Doug Ambrisko wrote: | > I was talking about the more general case since the system tries to keep | > the path in the stat structure. My prior approach which had more issues | > was to modify the stat structure of which I was pointed to NetBSD and their | > change to statvfs which doesn't really solve the problem. They don't | > have the check to see if the mount is longer then VFS_MNAMELEN (in their case) | > and just truncate things. | > | > If we are just talking about adding it to the mount structure that | > would be okay since it isn't exposed to user land. I can add that. | | Yes, this is exactly what I mean. Add a struct mount field, and use | it for kernel only. In fact, it only matters for sys_unmount() and | kern_jail.c, other locations in kernel use the path for warnings, and | this could be postponed if you prefer to minimize the patch. Okay, I went through all of the occurances and compile tested (except for #DEBUG). I united a few things but should do more once I get consensus on the approach. I found a few spots that should be updated as well and made the length check more consistant. Some were doing >= and others >. So this should be better, however, a lot larger. On the plus side when we figure out how to return the longer path length to user land that can be more flexible since the kernel is tracking the longer length. Probably things to note are changes in: ZFS to mount snapshot cd9660 for symlinks fuse to return full path jail to check statfs and mount mount/umount to save and check full path mountroot to save new field for full path Just in case it doesn't make it in email the full patch is at: http://people.freebsd.org/~ambrisko/mount_bigger.patch Thanks, Doug A. Index: cddl/compat/opensolaris/kern/opensolaris_vfs.c =================================================================== --- cddl/compat/opensolaris/kern/opensolaris_vfs.c (revision 257489) +++ cddl/compat/opensolaris/kern/opensolaris_vfs.c (working copy) @@ -126,7 +126,7 @@ * variables will fit in our mp buffers, including the * terminating NUL. */ - if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN) + if (strlen(fstype) > MFSNAMELEN || strlen(fspath) > MAXPATHLEN) return (ENAMETOOLONG); vfsp = vfs_byname_kld(fstype, td, &error); Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c =================================================================== --- cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (revision 257489) +++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (working copy) @@ -1069,12 +1069,12 @@ dmu_objset_rele(snap, FTAG); domount: - mountpoint_len = strlen(dvp->v_vfsp->mnt_stat.f_mntonname) + + mountpoint_len = strlen(dvp->v_vfsp->mnt_path) + strlen("/" ZFS_CTLDIR_NAME "/snapshot/") + strlen(nm) + 1; mountpoint = kmem_alloc(mountpoint_len, KM_SLEEP); (void) snprintf(mountpoint, mountpoint_len, "%s/" ZFS_CTLDIR_NAME "/snapshot/%s", - dvp->v_vfsp->mnt_stat.f_mntonname, nm); + dvp->v_vfsp->mnt_path, nm); err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); if (err == 0) { Index: fs/cd9660/cd9660_rrip.c =================================================================== --- fs/cd9660/cd9660_rrip.c (revision 257489) +++ fs/cd9660/cd9660_rrip.c (working copy) @@ -167,7 +167,7 @@ /* same as above */ outbuf -= len; len = 0; - inbuf = ana->imp->im_mountp->mnt_stat.f_mntonname; + inbuf = (char *)ana->imp->im_mountp->mnt_path; wlen = strlen(inbuf); break; Index: fs/ext2fs/ext2_lookup.c =================================================================== --- fs/ext2fs/ext2_lookup.c (revision 257489) +++ fs/ext2fs/ext2_lookup.c (working copy) @@ -802,10 +802,10 @@ mp = ITOV(ip)->v_mount; if ((mp->mnt_flag & MNT_RDONLY) == 0) panic("ext2_dirbad: %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_path, (u_long)ip->i_number,(long)offset, how); else (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_path, (u_long)ip->i_number, (long)offset, how); } Index: fs/fuse/fuse_vnops.c =================================================================== --- fs/fuse/fuse_vnops.c (revision 257489) +++ fs/fuse/fuse_vnops.c (working copy) @@ -1265,7 +1265,7 @@ } if (((char *)fdi.answ)[0] == '/' && fuse_get_mpdata(vnode_mount(vp))->dataflags & FSESS_PUSH_SYMLINKS_IN) { - char *mpth = vnode_mount(vp)->mnt_stat.f_mntonname; + char *mpth = (char *)vnode_mount(vp)->mnt_path; err = uiomove(mpth, strlen(mpth), uio); } Index: fs/nandfs/nandfs_segment.c =================================================================== --- fs/nandfs/nandfs_segment.c (revision 257489) +++ fs/nandfs/nandfs_segment.c (working copy) @@ -1275,7 +1275,7 @@ mp = (struct mount *)addr; db_printf("%p %s on %s (%s)\n", mp, mp->mnt_stat.f_mntfromname, - mp->mnt_stat.f_mntonname, mp->mnt_stat.f_fstypename); + mp->mnt_path, mp->mnt_stat.f_fstypename); nmp = (struct nandfsmount *)(mp->mnt_data); Index: fs/nullfs/null_vfsops.c =================================================================== --- fs/nullfs/null_vfsops.c (revision 257489) +++ fs/nullfs/null_vfsops.c (working copy) @@ -211,7 +211,7 @@ vfs_mountedfrom(mp, target); 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_path); return (0); } Index: fs/unionfs/union_vfsops.c =================================================================== --- fs/unionfs/union_vfsops.c (revision 257489) +++ fs/unionfs/union_vfsops.c (working copy) @@ -310,7 +310,7 @@ copystr(target, tmp, len, NULL); UNIONFSDEBUG("unionfs_mount: from %s, on %s\n", - mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); + mp->mnt_stat.f_mntfromname, mp->mnt_path); return (0); } Index: geom/journal/g_journal.c =================================================================== --- geom/journal/g_journal.c (revision 257489) +++ geom/journal/g_journal.c (working copy) @@ -2922,7 +2922,7 @@ goto next; } - mountpoint = mp->mnt_stat.f_mntonname; + mountpoint = (char *)mp->mnt_path; error = vn_start_write(NULL, &mp, V_WAIT); if (error != 0) { Index: gnu/fs/reiserfs/reiserfs_vfsops.c =================================================================== --- gnu/fs/reiserfs/reiserfs_vfsops.c (revision 257489) +++ gnu/fs/reiserfs/reiserfs_vfsops.c (working copy) @@ -309,7 +309,7 @@ reiserfs_log(LOG_DEBUG, "...done\n"); if (sbp != &mp->mnt_stat) { - reiserfs_log(LOG_DEBUG, "copying monut point info\n"); + reiserfs_log(LOG_DEBUG, "copying mount point info\n"); sbp->f_type = mp->mnt_vfc->vfc_typenum; bcopy((caddr_t)mp->mnt_stat.f_mntonname, (caddr_t)&sbp->f_mntonname[0], MNAMELEN); @@ -318,7 +318,7 @@ reiserfs_log(LOG_DEBUG, " mount from: %s\n", sbp->f_mntfromname); reiserfs_log(LOG_DEBUG, " mount on: %s\n", - sbp->f_mntonname); + mp->mnt_path); reiserfs_log(LOG_DEBUG, "...done\n"); } Index: kern/kern_jail.c =================================================================== --- kern/kern_jail.c (revision 257489) +++ kern/kern_jail.c (working copy) @@ -3555,7 +3555,6 @@ prison_canseemount(struct ucred *cred, struct mount *mp) { struct prison *pr; - struct statfs *sp; size_t len; pr = cred->cr_prison; @@ -3574,14 +3573,13 @@ if (strcmp(pr->pr_path, "/") == 0) return (0); len = strlen(pr->pr_path); - sp = &mp->mnt_stat; - if (strncmp(pr->pr_path, sp->f_mntonname, len) != 0) + if (strncmp(pr->pr_path, mp->mnt_path, len) != 0) return (ENOENT); /* * Be sure that we don't have situation where jail's root directory * is "/some/path" and mount point is "/some/pathpath". */ - if (sp->f_mntonname[len] != '\0' && sp->f_mntonname[len] != '/') + if (mp->mnt_path[len] != '\0' && mp->mnt_path[len] != '/') return (ENOENT); return (0); } Index: kern/vfs_mount.c =================================================================== --- kern/vfs_mount.c (revision 257489) +++ kern/vfs_mount.c (working copy) @@ -473,6 +473,7 @@ mp->mnt_cred = crdup(cred); mp->mnt_stat.f_owner = cred->cr_uid; strlcpy(mp->mnt_stat.f_mntonname, fspath, MNAMELEN); + strlcpy((char *)mp->mnt_path, fspath, MAXPATHLEN); mp->mnt_iosize_max = DFLTPHYS; #ifdef MAC mac_mount_init(mp); @@ -656,7 +657,7 @@ * variables will fit in our mp buffers, including the * terminating NUL. */ - if (fstypelen > MFSNAMELEN || fspathlen > MNAMELEN) { + if (fstypelen > MFSNAMELEN || fspathlen > MAXPATHLEN) { error = ENAMETOOLONG; goto bail; } @@ -748,8 +749,8 @@ return (EOPNOTSUPP); } - ma = mount_argsu(ma, "fstype", uap->type, MNAMELEN); - ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); + ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); + ma = mount_argsu(ma, "fspath", uap->path, MAXPATHLEN); ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); @@ -1040,7 +1041,7 @@ * variables will fit in our mp buffers, including the * terminating NUL. */ - if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN) + if (strlen(fstype) > MFSNAMELEN || strlen(fspath) > MAXPATHLEN) return (ENAMETOOLONG); if (jailed(td->td_ucred) || usermount == 0) { @@ -1095,9 +1096,9 @@ NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); + pathbuf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); strcpy(pathbuf, fspath); - error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); + error = vn_path_to_global_path(td, vp, pathbuf, MAXPATHLEN); /* debug.disablefullpath == 1 results in ENODEV */ if (error == 0 || error == ENODEV) { error = vfs_domount_first(td, vfsp, pathbuf, vp, @@ -1147,8 +1148,8 @@ return (error); } - pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->path, pathbuf, MNAMELEN, NULL); + pathbuf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + error = copyinstr(uap->path, pathbuf, MAXPATHLEN, NULL); if (error) { free(pathbuf, M_TEMP); return (error); @@ -1179,13 +1180,13 @@ if (namei(&nd) == 0) { NDFREE(&nd, NDF_ONLY_PNBUF); error = vn_path_to_global_path(td, nd.ni_vp, pathbuf, - MNAMELEN); + MAXPATHLEN); if (error == 0 || error == ENODEV) vput(nd.ni_vp); } mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { - if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) + if (strcmp(mp->mnt_path, pathbuf) == 0) break; } mtx_unlock(&mountlist_mtx); Index: kern/vfs_mountroot.c =================================================================== --- kern/vfs_mountroot.c (revision 257489) +++ kern/vfs_mountroot.c (working copy) @@ -307,6 +307,8 @@ vp->v_mountedhere = mporoot; strlcpy(mporoot->mnt_stat.f_mntonname, fspath, MNAMELEN); + strlcpy((char *)mporoot->mnt_path, + fspath, MAXPATHLEN); VOP_UNLOCK(vp, 0); } else vput(vp); Index: kern/vfs_subr.c =================================================================== --- kern/vfs_subr.c (revision 257489) +++ kern/vfs_subr.c (working copy) @@ -2962,7 +2962,7 @@ TAILQ_FOREACH(mp, &mountlist, mnt_list) { db_printf("%p %s on %s (%s)\n", mp, mp->mnt_stat.f_mntfromname, - mp->mnt_stat.f_mntonname, + mp->mnt_path, mp->mnt_stat.f_fstypename); if (db_pager_quit) break; @@ -2973,7 +2973,7 @@ mp = (struct mount *)addr; db_printf("%p %s on %s (%s)\n", mp, mp->mnt_stat.f_mntfromname, - mp->mnt_stat.f_mntonname, mp->mnt_stat.f_fstypename); + mp->mnt_path, mp->mnt_stat.f_fstypename); buf[0] = '\0'; mflags = mp->mnt_flag; @@ -3406,7 +3406,7 @@ */ if (strcmp(mp->mnt_vfc->vfc_name, "devfs") != 0) { printf("unmount of %s failed (", - mp->mnt_stat.f_mntonname); + mp->mnt_path); if (error == EBUSY) printf("BUSY)\n"); else Index: security/mac_lomac/mac_lomac.c =================================================================== --- security/mac_lomac/mac_lomac.c (revision 257489) +++ security/mac_lomac/mac_lomac.c (working copy) @@ -569,7 +569,7 @@ "mountpount=%s)\n", subjlabeltext, p->p_pid, pgid, curthread->td_ucred->cr_uid, p->p_comm, subjtext, actionname, objlabeltext, objname, - va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); + va.va_fileid, vp->v_mount->mnt_path); } else { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" " level %s after %s a level-%s %s\n", Index: sys/mount.h =================================================================== --- sys/mount.h (revision 257489) +++ sys/mount.h (working copy) @@ -190,6 +190,7 @@ struct lock mnt_explock; /* vfs_export walkers lock */ TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ + const char mnt_path[MAXPATHLEN]; /* actual mount path */ }; /* Index: ufs/ffs/ffs_alloc.c =================================================================== --- ufs/ffs/ffs_alloc.c (revision 257489) +++ ufs/ffs/ffs_alloc.c (working copy) @@ -2748,7 +2748,7 @@ case FFS_SET_FLAGS: #ifdef DEBUG if (fsckcmds) - printf("%s: %s flags\n", mp->mnt_stat.f_mntonname, + printf("%s: %s flags\n", mp->mnt_path, cmd.size > 0 ? "set" : "clear"); #endif /* DEBUG */ if (cmd.size > 0) @@ -2761,7 +2761,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust inode %jd link count by %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + mp->mnt_path, (intmax_t)cmd.value, (intmax_t)cmd.size); } #endif /* DEBUG */ @@ -2782,7 +2782,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust inode %jd block count by %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + mp->mnt_path, (intmax_t)cmd.value, (intmax_t)cmd.size); } #endif /* DEBUG */ @@ -2804,12 +2804,12 @@ if (fsckcmds) { if (cmd.size == 1) printf("%s: free %s inode %ju\n", - mp->mnt_stat.f_mntonname, + mp->mnt_path, filetype == IFDIR ? "directory" : "file", (uintmax_t)cmd.value); else printf("%s: free %s inodes %ju-%ju\n", - mp->mnt_stat.f_mntonname, + mp->mnt_path, filetype == IFDIR ? "directory" : "file", (uintmax_t)cmd.value, (uintmax_t)(cmd.value + cmd.size - 1)); @@ -2829,11 +2829,11 @@ if (fsckcmds) { if (cmd.size == 1) printf("%s: free block %jd\n", - mp->mnt_stat.f_mntonname, + mp->mnt_path, (intmax_t)cmd.value); else printf("%s: free blocks %jd-%jd\n", - mp->mnt_stat.f_mntonname, + mp->mnt_path, (intmax_t)cmd.value, (intmax_t)cmd.value + cmd.size - 1); } @@ -2860,7 +2860,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust number of directories by %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ fs->fs_cstotal.cs_ndir += cmd.value; @@ -2870,7 +2870,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust number of free blocks by %+jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ fs->fs_cstotal.cs_nbfree += cmd.value; @@ -2880,7 +2880,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust number of free inodes by %+jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ fs->fs_cstotal.cs_nifree += cmd.value; @@ -2890,7 +2890,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust number of free frags by %+jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ fs->fs_cstotal.cs_nffree += cmd.value; @@ -2900,7 +2900,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: adjust number of free clusters by %+jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ fs->fs_cstotal.cs_numclusters += cmd.value; @@ -2910,7 +2910,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: set current directory to inode %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_SHARED, &vp))) @@ -2933,7 +2933,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: change .. in cwd from %jd to %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + mp->mnt_path, (intmax_t)cmd.value, (intmax_t)cmd.size); } #endif /* DEBUG */ @@ -2972,7 +2972,7 @@ if (copyinstr((char *)(intptr_t)cmd.value, buf,32,NULL)) strncpy(buf, "Name_too_long", 32); printf("%s: unlink %s (inode %jd)\n", - mp->mnt_stat.f_mntonname, buf, (intmax_t)cmd.size); + mp->mnt_path, buf, (intmax_t)cmd.size); } #endif /* DEBUG */ /* @@ -2994,7 +2994,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: update inode %jd\n", - mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + mp->mnt_path, (intmax_t)cmd.value); } #endif /* DEBUG */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) @@ -3028,7 +3028,7 @@ #ifdef DEBUG if (fsckcmds) { printf("%s: %s buffered output for descriptor %jd\n", - mp->mnt_stat.f_mntonname, + mp->mnt_path, cmd.size == 1 ? "enable" : "disable", (intmax_t)cmd.value); } Index: ufs/ffs/ffs_snapshot.c =================================================================== --- ufs/ffs/ffs_snapshot.c (revision 257489) +++ ufs/ffs/ffs_snapshot.c (working copy) @@ -693,7 +693,7 @@ nanotime(&endtime); timespecsub(&endtime, &starttime); printf("%s: suspended %ld.%03ld sec, redo %ld of %d\n", - vp->v_mount->mnt_stat.f_mntonname, (long)endtime.tv_sec, + vp->v_mount->mnt_path, (long)endtime.tv_sec, endtime.tv_nsec / 1000000, redo, fs->fs_ncg); } if (copy_fs == NULL) Index: ufs/ffs/ffs_softdep.c =================================================================== --- ufs/ffs/ffs_softdep.c (revision 257489) +++ ufs/ffs/ffs_softdep.c (working copy) @@ -733,7 +733,7 @@ * Internal function prototypes. */ static void check_clear_deps(struct mount *); -static void softdep_error(char *, int); +static void softdep_error(const char *, int); static int softdep_process_worklist(struct mount *, int); static int softdep_waitidle(struct mount *); static void drain_output(struct vnode *); @@ -13771,7 +13771,7 @@ if ((bp->b_ioflags & BIO_ERROR) == 0) panic("softdep_deallocate_dependencies: dangling deps"); if (bp->b_vp != NULL && bp->b_vp->v_mount != NULL) - softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, bp->b_error); + softdep_error(bp->b_vp->v_mount->mnt_path, bp->b_error); else printf("softdep_deallocate_dependencies: " "got error %d while accessing filesystem\n", bp->b_error); @@ -13784,7 +13784,7 @@ */ static void softdep_error(func, error) - char *func; + const char *func; int error; { @@ -13916,7 +13916,7 @@ db_print_ffs(struct ufsmount *ump) { db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", - ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, + ump->um_mountp, ump->um_mountp->mnt_path, ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, ump->softdep_deps, ump->softdep_req); } Index: ufs/ffs/ffs_vfsops.c =================================================================== --- ufs/ffs/ffs_vfsops.c (revision 257489) +++ ufs/ffs/ffs_vfsops.c (working copy) @@ -533,7 +533,7 @@ * We need the name for the mount point (also used for * "last mounted on") copied in. If an error occurs, * the mount point is discarded by the upper level code. - * Note that vfs_mount() populates f_mntonname for us. + * Note that vfs_mount() populates mnt_path for us. */ if ((error = ffs_mountfs(devvp, mp, td)) != 0) { vrele(devvp); @@ -885,13 +885,13 @@ } else { printf("WARNING: %s: GJOURNAL flag on fs " "but no gjournal provider below\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } #else printf("WARNING: %s: GJOURNAL flag on fs but no " - "UFS_GJOURNAL support\n", mp->mnt_stat.f_mntonname); + "UFS_GJOURNAL support\n", mp->mnt_path); #endif } else { mp->mnt_gjprovider = NULL; @@ -976,7 +976,7 @@ MNT_IUNLOCK(mp); #else printf("WARNING: %s: multilabel flag on fs but " - "no MAC support\n", mp->mnt_stat.f_mntonname); + "no MAC support\n", mp->mnt_path); #endif } if ((fs->fs_flags & FS_ACLS) != 0) { @@ -986,7 +986,7 @@ if (mp->mnt_flag & MNT_NFS4ACLS) printf("WARNING: %s: ACLs flag on fs conflicts with " "\"nfsv4acls\" mount option; option ignored\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; @@ -993,7 +993,7 @@ MNT_IUNLOCK(mp); #else printf("WARNING: %s: ACLs flag on fs but no ACLs support\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); #endif } if ((fs->fs_flags & FS_NFS4ACLS) != 0) { @@ -1003,7 +1003,7 @@ if (mp->mnt_flag & MNT_ACLS) printf("WARNING: %s: NFSv4 ACLs flag on fs conflicts " "with \"acls\" mount option; option ignored\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); mp->mnt_flag &= ~MNT_ACLS; mp->mnt_flag |= MNT_NFS4ACLS; @@ -1010,7 +1010,7 @@ MNT_IUNLOCK(mp); #else printf("WARNING: %s: NFSv4 ACLs flag on fs but no " - "ACLs support\n", mp->mnt_stat.f_mntonname); + "ACLs support\n", mp->mnt_path); #endif } if ((fs->fs_flags & FS_TRIM) != 0) { @@ -1020,11 +1020,11 @@ if (!ump->um_candelete) printf("WARNING: %s: TRIM flag on fs but disk " "does not support TRIM\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); } else { printf("WARNING: %s: TRIM flag on fs but disk does " "not confirm that it supports TRIM\n", - mp->mnt_stat.f_mntonname); + mp->mnt_path); ump->um_candelete = 0; } } @@ -1044,7 +1044,7 @@ * Set FS local "last mounted on" information (NULL pad) */ bzero(fs->fs_fsmnt, MAXMNTLEN); - strlcpy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MAXMNTLEN); + strlcpy(fs->fs_fsmnt, mp->mnt_path, MAXMNTLEN); mp->mnt_stat.f_iosize = fs->fs_bsize; if (mp->mnt_flag & MNT_ROOTFS) { @@ -1241,7 +1241,7 @@ if ((error = ufs_extattr_stop(mp, td))) { if (error != EOPNOTSUPP) printf("WARNING: unmount %s: ufs_extattr_stop " - "returned errno %d\n", mp->mnt_stat.f_mntonname, + "returned errno %d\n", mp->mnt_path, error); e_restart = 0; } else { Index: ufs/ufs/ufs_extattr.c =================================================================== --- ufs/ufs/ufs_extattr.c (revision 257489) +++ ufs/ufs/ufs_extattr.c (working copy) @@ -923,7 +923,7 @@ * up by the next write or extattrctl clean. */ printf("ufs_extattr_get (%s): inode number inconsistency (%d, %ju)\n", - mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (uintmax_t)ip->i_gen); + mp->mnt_path, ueh.ueh_i_gen, (uintmax_t)ip->i_gen); error = ENOATTR; goto vopunlock_exit; } @@ -1228,7 +1228,7 @@ * the next write or extattrctl clean. */ printf("ufs_extattr_rm (%s): inode number inconsistency (%d, %jd)\n", - mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (intmax_t)ip->i_gen); + mp->mnt_path, ueh.ueh_i_gen, (intmax_t)ip->i_gen); error = ENOATTR; goto vopunlock_exit; } Index: ufs/ufs/ufs_lookup.c =================================================================== --- ufs/ufs/ufs_lookup.c (revision 257489) +++ ufs/ufs/ufs_lookup.c (working copy) @@ -771,11 +771,11 @@ mp = ITOV(ip)->v_mount; if ((mp->mnt_flag & MNT_RDONLY) == 0) panic("ufs_dirbad: %s: bad dir ino %ju at offset %ld: %s", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + mp->mnt_path, (uintmax_t)ip->i_number, (long)offset, how); else (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + mp->mnt_path, (uintmax_t)ip->i_number, (long)offset, how); } Index: ufs/ufs/ufs_quota.c =================================================================== --- ufs/ufs/ufs_quota.c (revision 257489) +++ ufs/ufs/ufs_quota.c (working copy) @@ -238,7 +238,7 @@ DQI_UNLOCK(dq); if (warn) uprintf("\n%s: warning, %s disk quota exceeded\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[i]); } return (0); @@ -264,7 +264,7 @@ dq->dq_flags |= DQ_BLKS; DQI_UNLOCK(dq); uprintf("\n%s: write failed, %s disk limit reached\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[type]); return (EDQUOT); } @@ -289,7 +289,7 @@ DQI_UNLOCK(dq); uprintf("\n%s: write failed, %s " "disk quota exceeded for too long\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[type]); return (EDQUOT); } @@ -382,7 +382,7 @@ DQI_UNLOCK(dq); if (warn) uprintf("\n%s: warning, %s inode quota exceeded\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[i]); } return (0); @@ -407,7 +407,7 @@ dq->dq_flags |= DQ_INODS; DQI_UNLOCK(dq); uprintf("\n%s: write failed, %s inode limit reached\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[type]); return (EDQUOT); } @@ -432,7 +432,7 @@ DQI_UNLOCK(dq); uprintf("\n%s: write failed, %s " "inode quota exceeded for too long\n", - ITOV(ip)->v_mount->mnt_stat.f_mntonname, + ITOV(ip)->v_mount->mnt_path, quotatypes[type]); return (EDQUOT); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131121174028.GA80520>