Author: mav
Date: Thu Oct  8 07:34:30 2015
New Revision: 289017
URL: https://svnweb.freebsd.org/changeset/base/289017

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

Modified:
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c        Thu Oct  8 07:31:05 2015        
(r289016)
+++ head/sys/cam/ctl/ctl_backend_block.c        Thu Oct  8 07:34:30 2015        
(r289017)
@@ -2623,9 +2623,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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to