Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133519551
D28401.id83050.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
D28401.id83050.diff
View Options
Index: sys/fs/tmpfs/tmpfs_vnops.c
===================================================================
--- sys/fs/tmpfs/tmpfs_vnops.c
+++ sys/fs/tmpfs/tmpfs_vnops.c
@@ -84,7 +84,8 @@
}
static int
-tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
+tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
+ bool cached)
{
struct tmpfs_dirent *de;
struct tmpfs_node *dnode, *pnode;
@@ -94,10 +95,16 @@
dnode = VP_TO_TMPFS_DIR(dvp);
*vpp = NULLVP;
- /* Check accessibility of requested node as a first step. */
- error = vn_dir_check_exec(dvp, cnp);
- if (error != 0)
- goto out;
+ /*
+ * Check accessibility of requested node as a first step. If we are
+ * coming in via VOP_CACHEDLOOKUP, then this has already been done for
+ * us and we must not check again.
+ */
+ if (!cached) {
+ error = vn_dir_check_exec(dvp, cnp);
+ if (error != 0)
+ goto out;
+ }
/* We cannot be requesting the parent directory of the root node. */
MPASS(IMPLIES(dnode->tn_type == VDIR &&
@@ -235,14 +242,14 @@
tmpfs_cached_lookup(struct vop_cachedlookup_args *v)
{
- return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp));
+ return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp, true));
}
static int
tmpfs_lookup(struct vop_lookup_args *v)
{
- return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp));
+ return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp, false));
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 27, 9:04 AM (15 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24285376
Default Alt Text
D28401.id83050.diff (1 KB)
Attached To
Mode
D28401: tmpfs: push VEXEC check into tmpfs_lookup()
Attached
Detach File
Event Timeline
Log In to Comment