From owner-svn-src-all@FreeBSD.ORG Sun Oct 12 14:20:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EF493A7; Sun, 12 Oct 2014 14:20:23 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6AA5CC0; Sun, 12 Oct 2014 14:20:22 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s9CEKGpR029888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Oct 2014 17:20:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s9CEKGpR029888 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s9CEKGqF029887; Sun, 12 Oct 2014 17:20:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 Oct 2014 17:20:16 +0300 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r272952 - in head/sys: fs/ext2fs fs/msdosfs ufs/ffs Message-ID: <20141012142016.GI2153@kib.kiev.ua> References: <201410111909.s9BJ9ueU031008@svn.freebsd.org> <20141013003313.G932@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141013003313.G932@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sun, 12 Oct 2014 14:20:23 -0000 On Mon, Oct 13, 2014 at 12:39:54AM +1100, Bruce Evans wrote: > > @@ -627,7 +627,7 @@ ffs_read(ap) > > } > > > > if ((error == 0 || uio->uio_resid != orig_resid) && > > - (vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && > > + (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0 && > > (ip->i_flag & IN_ACCESS) == 0) { > > VI_LOCK(vp); > > ip->i_flag |= IN_ACCESS; > > > > Is it correct for only ffs to acquire the vnode interlock? I think it > is, but don't remember which ffs-only feature requires it. We either hold the vnode lock exclusive, or shared + own the vnode interlock, for i_flag modifications. Since this is ffs_read(), which is entered with the vnode shared locked, the interlock must be acquired. Both msdosfs and ext2fs do not enable the shared locking mode for the lockmgr locks serving as the vnodes locks, so msdosfs_read() and ext2_read() are executed with vnode locked exclusively.