Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148384263
D40854.1786568956.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
936 B
Referenced Files
None
Subscribers
None
D40854.1786568956.diff
View Options
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -895,8 +895,7 @@
int
sys_fchdir(struct thread *td, struct fchdir_args *uap)
{
- struct vnode *vp, *tdp;
- struct mount *mp;
+ struct vnode *vp;
struct file *fp;
int error;
@@ -908,23 +907,17 @@
vp = fp->f_vnode;
vrefact(vp);
fdrop(fp, td);
+
vn_lock(vp, LK_SHARED | LK_RETRY);
AUDIT_ARG_VNODE1(vp);
error = change_dir(vp, td);
- while (!error && (mp = vp->v_mountedhere) != NULL) {
- if (vfs_busy(mp, 0))
- continue;
- error = VFS_ROOT(mp, LK_SHARED, &tdp);
- vfs_unbusy(mp);
- if (error != 0)
- break;
- vput(vp);
- vp = tdp;
- }
- if (error != 0) {
+ if (__predict_false(error != 0)) {
vput(vp);
return (error);
}
+ error = vn_cross_mounts(vp, LK_SHARED, &vp);
+ if (__predict_false(error != 0))
+ return (error);
VOP_UNLOCK(vp);
pwd_chdir(td, vp);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 12, 9:09 PM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29400060
Default Alt Text
D40854.1786568956.diff (936 B)
Attached To
Mode
D40854: sys_fchdir(): Use vn_cross_mounts()
Attached
Detach File
Event Timeline
Log In to Comment