Date: Thu, 15 Oct 2015 08:49:52 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r289363 - stable/10/sys/cam/ctl Message-ID: <201510150849.t9F8nq1F014405@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510150849.t9F8nq1F014405>