From owner-cvs-all@FreeBSD.ORG Sun Oct 5 03:14:05 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD1D716A4C0; Sun, 5 Oct 2003 03:14:05 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10C3243FEC; Sun, 5 Oct 2003 03:14:05 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h95ADqN1049043; Sun, 5 Oct 2003 03:13:56 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200310051013.h95ADqN1049043@gw.catspoiler.org> Date: Sun, 5 Oct 2003 03:13:52 -0700 (PDT) From: Don Lewis To: jroberson@chesapeake.net In-Reply-To: <20031005041049.L99666-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: cvs-src@FreeBSD.org cc: jeff@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Oct 2003 10:14:06 -0000 On 5 Oct, Jeff Roberson wrote: > On Sun, 5 Oct 2003, Don Lewis wrote: > >> On 5 Oct, Jeff Roberson wrote: >> > jeff 2003/10/05 00:12:38 PDT >> > >> > FreeBSD src repository >> > >> > Modified files: >> > sys/kern vfs_subr.c >> > Log: >> > - Fix an XXX. Check the error of vn_lock() in vflush(). Don't specify >> > LK_RETRY either, we don't want this vnode if it turns into another. >> > - Remove the code that checks the mount point after acquiring the lock >> > we are guaranteed to either fail or get the vnode that we wanted. >> > >> > Revision Changes Path >> > 1.465 +2 -13 src/sys/kern/vfs_subr.c >> >> What keeps this from spinning if some other thread holds the lock on the >> first vnode on the list? >> > > It should only fail if the vnode was vcleaned() out from under us, right? > If that's the case than the list has been modified by the time we relock > it and check. > > Do you agree What about the !FORCECLOSE case where the vnode is locked by some other thread that is doing I/O on it? The call to vn_lock() will fail, we'll re-lock mntvnode_mtx, start the loop again, and immediately try to lock the same vnode again. It looks to me like we either need to sleep and wait for the vnode lock, or we need to skip to the next vnode and try this vnode again later.