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) {
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to