Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168194818
D21518.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
D21518.diff
View Options
Index: head/sys/fs/pseudofs/pseudofs_vnops.c
===================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c
+++ head/sys/fs/pseudofs/pseudofs_vnops.c
@@ -809,23 +809,28 @@
if (resid == 0)
PFS_RETURN (0);
- if (!pfs_lookup_proc(pid, &proc))
+ proc = NULL;
+ if (pid != NO_PID && !pfs_lookup_proc(pid, &proc))
PFS_RETURN (ENOENT);
sx_slock(&allproc_lock);
pfs_lock(pd);
- PROC_LOCK(proc);
- /* check if the directory is visible to the caller */
- if (!pfs_visible_proc(curthread, pd, proc)) {
- _PRELE(proc);
- PROC_UNLOCK(proc);
- sx_sunlock(&allproc_lock);
- pfs_unlock(pd);
- PFS_RETURN (ENOENT);
- }
KASSERT(pid == NO_PID || proc != NULL,
("%s(): no process for pid %lu", __func__, (unsigned long)pid));
+
+ if (pid != NO_PID) {
+ PROC_LOCK(proc);
+
+ /* check if the directory is visible to the caller */
+ if (!pfs_visible_proc(curthread, pd, proc)) {
+ _PRELE(proc);
+ PROC_UNLOCK(proc);
+ sx_sunlock(&allproc_lock);
+ pfs_unlock(pd);
+ PFS_RETURN (ENOENT);
+ }
+ }
/* skip unwanted entries */
for (pn = NULL, p = NULL; offset > 0; offset -= PFS_DELEN) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 7:57 PM (18 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37414134
Default Alt Text
D21518.diff (1 KB)
Attached To
Mode
D21518: pseudofs: make readdir work without a pid again
Attached
Detach File
Event Timeline
Log In to Comment