svn commit: r276200 - head/sys/kern

Rick Macklem rmacklem at FreeBSD.org
Thu Dec 25 14:44:05 UTC 2014


Author: rmacklem
Date: Thu Dec 25 14:44:04 2014
New Revision: 276200
URL: https://svnweb.freebsd.org/changeset/base/276200

Log:
  Fix the comment introduced in r276192 so that it clearly
  states that the change is needed to avoid a deadlock.
  
  Suggested by:	kib
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Thu Dec 25 13:38:51 2014	(r276199)
+++ head/sys/kern/vfs_default.c	Thu Dec 25 14:44:04 2014	(r276200)
@@ -407,9 +407,10 @@ vop_stdadvlock(struct vop_advlock_args *
 	vp = ap->a_vp;
 	if (ap->a_fl->l_whence == SEEK_END) {
 		/*
-		 * The NFSv4 server will LOR/deadlock if a vn_lock() call
-		 * is done on vp. Fortunately, vattr.va_size is only
-		 * needed for SEEK_END and the NFSv4 server only uses SEEK_SET.
+		 * The NFSv4 server must avoid doing a vn_lock() here, since it
+		 * can deadlock the nfsd threads, due to a LOR.  Fortunately
+		 * the NFSv4 server always uses SEEK_SET and this code is
+		 * only required for the SEEK_END case.
 		 */
 		vn_lock(vp, LK_SHARED | LK_RETRY);
 		error = VOP_GETATTR(vp, &vattr, curthread->td_ucred);


More information about the svn-src-head mailing list