From owner-svn-src-all@freebsd.org Thu Oct 8 07:34:31 2015 Return-Path: Delivered-To: svn-src-all@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 954DE9D19C0; Thu, 8 Oct 2015 07:34:31 +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 61588F8C; Thu, 8 Oct 2015 07:34:31 +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 t987YUB3054813; Thu, 8 Oct 2015 07:34:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t987YU6v054812; Thu, 8 Oct 2015 07:34:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510080734.t987YU6v054812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Oct 2015 07:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289017 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 07:34:31 -0000 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) {