Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167421537
D25616.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
731 B
Referenced Files
None
Subscribers
None
D25616.diff
View Options
Index: head/sys/kern/kern_descrip.c
===================================================================
--- head/sys/kern/kern_descrip.c
+++ head/sys/kern/kern_descrip.c
@@ -3347,13 +3347,17 @@
fdp = td->td_proc->p_fd;
smr_enter(pwd_smr);
- for (;;) {
- pwd = smr_entered_load(&fdp->fd_pwd, pwd_smr);
- MPASS(pwd != NULL);
- if (refcount_acquire_if_not_zero(&pwd->pwd_refcount))
- break;
+ pwd = smr_entered_load(&fdp->fd_pwd, pwd_smr);
+ MPASS(pwd != NULL);
+ if (__predict_true(refcount_acquire_if_not_zero(&pwd->pwd_refcount))) {
+ smr_exit(pwd_smr);
+ return (pwd);
}
smr_exit(pwd_smr);
+ FILEDESC_SLOCK(fdp);
+ pwd = pwd_hold_filedesc(fdp);
+ MPASS(pwd != NULL);
+ FILEDESC_SUNLOCK(fdp);
return (pwd);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 22, 3:47 PM (6 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37094859
Default Alt Text
D25616.diff (731 B)
Attached To
Mode
D25616: fd: stop looping in pwd_hold
Attached
Detach File
Event Timeline
Log In to Comment