Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136903602
D23885.id68966.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23885.id68966.diff
View Options
Index: sys/kern/vfs_lookup.c
===================================================================
--- sys/kern/vfs_lookup.c
+++ sys/kern/vfs_lookup.c
@@ -254,7 +254,7 @@
}
static int
-namei_handle_root(struct nameidata *ndp, struct vnode **dpp, u_int n)
+namei_handle_root(struct nameidata *ndp, struct vnode **dpp)
{
struct componentname *cnp;
@@ -276,7 +276,7 @@
ndp->ni_pathlen--;
}
*dpp = ndp->ni_rootdir;
- vrefactn(*dpp, n);
+ vrefact(*dpp);
return (0);
}
@@ -407,29 +407,15 @@
cnp->cn_nameptr = cnp->cn_pnbuf;
if (cnp->cn_pnbuf[0] == '/') {
ndp->ni_resflags |= NIRES_ABS;
- error = namei_handle_root(ndp, &dp, 2);
- if (error != 0) {
- /*
- * Simplify error handling, we should almost never be
- * here.
- */
- vrefact(ndp->ni_rootdir);
- }
+ error = namei_handle_root(ndp, &dp);
} else {
if (ndp->ni_startdir != NULL) {
- vrefact(ndp->ni_rootdir);
dp = ndp->ni_startdir;
startdir_used = 1;
} else if (ndp->ni_dirfd == AT_FDCWD) {
dp = pwd->pwd_cdir;
- if (dp == ndp->ni_rootdir) {
- vrefactn(dp, 2);
- } else {
- vrefact(ndp->ni_rootdir);
- vrefact(dp);
- }
+ vrefact(dp);
} else {
- vrefact(ndp->ni_rootdir);
rights = ndp->ni_rightsneeded;
cap_rights_set_one(&rights, CAP_LOOKUP);
@@ -527,7 +513,6 @@
* If not a symbolic link, we're done.
*/
if ((cnp->cn_flags & ISSYMLINK) == 0) {
- vrele(ndp->ni_rootdir);
if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) {
namei_cleanup_cnp(cnp);
} else
@@ -602,7 +587,7 @@
cnp->cn_nameptr = cnp->cn_pnbuf;
if (*(cnp->cn_nameptr) == '/') {
vrele(dp);
- error = namei_handle_root(ndp, &dp, 1);
+ error = namei_handle_root(ndp, &dp);
if (error != 0)
goto out;
}
@@ -611,7 +596,6 @@
ndp->ni_vp = NULL;
vrele(ndp->ni_dvp);
out:
- vrele(ndp->ni_rootdir);
MPASS(error != 0);
namei_cleanup_cnp(cnp);
nameicap_cleanup(ndp, true);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 1:47 PM (11 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25768153
Default Alt Text
D23885.id68966.diff (1 KB)
Attached To
Mode
D23885: (pwd 3/3) vfs: stop taking additional refs on root vnode during lookup
Attached
Detach File
Event Timeline
Log In to Comment