From owner-svn-src-stable@freebsd.org Thu Oct 15 08:49:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06B49B61E7; Thu, 15 Oct 2015 08:49:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3CF1055; Thu, 15 Oct 2015 08:49:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9F8nqgM014406; Thu, 15 Oct 2015 08:49:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9F8nq1F014405; Thu, 15 Oct 2015 08:49:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510150849.t9F8nq1F014405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 15 Oct 2015 08:49:52 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2015 08:49:53 -0000 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) {