From d94da54d9573b12d2d1107664273f7db5c5619dc Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 23 Jan 2009 22:13:30 +0000 Subject: [PATCH] Use shared vnode locks for fchdir(). Submitted by: ups --- sys/kern/vfs_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 4d3978ab32b9..a910bf3eaad9 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -758,7 +758,7 @@ fchdir(td, uap) VREF(vp); fdrop(fp, td); vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, vp, ARG_VNODE1); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { @@ -766,7 +766,7 @@ fchdir(td, uap) if (vfs_busy(mp, 0)) continue; tvfslocked = VFS_LOCK_GIANT(mp); - error = VFS_ROOT(mp, LK_EXCLUSIVE, &tdp, td); + error = VFS_ROOT(mp, LK_SHARED, &tdp, td); vfs_unbusy(mp); if (error) { VFS_UNLOCK_GIANT(tvfslocked);