FreeBSD Bugzilla – Attachment 9446 Details for
Bug 19331
Broken linprocfs filesystem in -stable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.20 KB, created by
Vladimir N.Silyaev
on 2000-06-16 12:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Vladimir N.Silyaev
Created:
2000-06-16 12:40:01 UTC
Size:
2.20 KB
patch
obsolete
>--- vfs_cache.c.orig Mon Feb 14 01:09:01 2000 >+++ vfs_cache.c Fri May 26 06:11:22 2000 >@@ -587,3 +587,97 @@ > return (error); > } > >+/* >+ * Thus begins the fullpath magic. >+ */ >+ >+#undef STATNODE >+#define STATNODE(name) \ >+ static u_int name; \ >+ SYSCTL_INT(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, "") >+ >+static int disablefullpath; >+SYSCTL_INT(_debug, OID_AUTO, disablefullpath, CTLFLAG_RW, >+ &disablefullpath, 0, ""); >+ >+STATNODE(numfullpathcalls); >+STATNODE(numfullpathfail1); >+STATNODE(numfullpathfail2); >+STATNODE(numfullpathfail3); >+STATNODE(numfullpathfail4); >+STATNODE(numfullpathfound); >+ >+int >+textvp_fullpath(struct proc *p, char **retbuf, char **retfreebuf) { >+ char *bp, *buf; >+ int i, slash_prefixed; >+ struct filedesc *fdp; >+ struct namecache *ncp; >+ struct vnode *vp, *textvp; >+ >+ numfullpathcalls++; >+ if (disablefullpath) >+ return (ENODEV); >+ textvp = p->p_textvp; >+ if (textvp == NULL) >+ return (EINVAL); >+ buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); >+ bp = buf + MAXPATHLEN - 1; >+ *bp = '\0'; >+ fdp = p->p_fd; >+ slash_prefixed = 0; >+ for (vp = textvp; vp != fdp->fd_rdir && vp != rootvnode;) { >+ if (vp->v_flag & VROOT) { >+ if (vp->v_mount == NULL) { /* forced unmount */ >+ free(buf, M_TEMP); >+ return (EBADF); >+ } >+ vp = vp->v_mount->mnt_vnodecovered; >+ continue; >+ } >+ if (vp != textvp && vp->v_dd->v_id != vp->v_ddid) { >+ numfullpathfail1++; >+ free(buf, M_TEMP); >+ return (ENOTDIR); >+ } >+ ncp = TAILQ_FIRST(&vp->v_cache_dst); >+ if (!ncp) { >+ numfullpathfail2++; >+ free(buf, M_TEMP); >+ return (ENOENT); >+ } >+ if (vp != textvp && ncp->nc_dvp != vp->v_dd) { >+ numfullpathfail3++; >+ free(buf, M_TEMP); >+ return (EBADF); >+ } >+ for (i = ncp->nc_nlen - 1; i >= 0; i--) { >+ if (bp == buf) { >+ numfullpathfail4++; >+ free(buf, M_TEMP); >+ return (ENOMEM); >+ } >+ *--bp = ncp->nc_name[i]; >+ } >+ if (bp == buf) { >+ numfullpathfail4++; >+ free(buf, M_TEMP); >+ return (ENOMEM); >+ } >+ *--bp = '/'; >+ slash_prefixed = 1; >+ vp = ncp->nc_dvp; >+ } >+ if (!slash_prefixed) { >+ if (bp == buf) { >+ numfullpathfail4++; >+ free(buf, M_TEMP); >+ return (ENOMEM); >+ } >+ *--bp = '/'; >+ } >+ numfullpathfound++; >+ *retbuf = bp; >+ *retfreebuf = buf; >+ return (0); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19331
: 9446