svn commit: r289363 - stable/10/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Thu Oct 15 08:49:53 UTC 2015


Author: mav
Date: Thu Oct 15 08:49:52 2015
New Revision: 289363
URL: https://svnweb.freebsd.org/changeset/base/289363

Log:
  MFC r289017: Add missing vnode lock in case of file modify request.
  
  Submitted by:	Richard Kojedzinszky

Modified:
  stable/10/sys/cam/ctl/ctl_backend_block.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_backend_block.c	Thu Oct 15 08:47:32 2015	(r289362)
+++ stable/10/sys/cam/ctl/ctl_backend_block.c	Thu Oct 15 08:49:52 2015	(r289363)
@@ -2637,9 +2637,11 @@ ctl_be_block_modify(struct ctl_be_block_
 			error = ctl_be_block_open(be_lun, req);
 		else if (vn_isdisk(be_lun->vn, &error))
 			error = ctl_be_block_open_dev(be_lun, req);
-		else if (be_lun->vn->v_type == VREG)
+		else if (be_lun->vn->v_type == VREG) {
+			vn_lock(be_lun->vn, LK_SHARED | LK_RETRY);
 			error = ctl_be_block_open_file(be_lun, req);
-		else
+			VOP_UNLOCK(be_lun->vn, 0);
+		} else
 			error = EINVAL;
 		if ((cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) &&
 		    be_lun->vn != NULL) {


More information about the svn-src-stable-10 mailing list