From owner-freebsd-fs@FreeBSD.ORG Thu Aug 29 00:56:27 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2099278 for ; Thu, 29 Aug 2013 00:56:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B38A32535 for ; Thu, 29 Aug 2013 00:56:26 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r7T0uGwA044085; Thu, 29 Aug 2013 03:56:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r7T0uGwA044085 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r7T0uGas044084; Thu, 29 Aug 2013 03:56:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Aug 2013 03:56:16 +0300 From: Konstantin Belousov To: Rick Macklem Subject: Re: fixing "umount -f" for the NFS client Message-ID: <20130829005616.GH4972@kib.kiev.ua> References: <2057976640.15042430.1377735327317.JavaMail.root@uoguelph.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="huwNgOI5TI5AwA3T" Content-Disposition: inline In-Reply-To: <2057976640.15042430.1377735327317.JavaMail.root@uoguelph.ca> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-fs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 00:56:27 -0000 --huwNgOI5TI5AwA3T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2013 at 08:15:27PM -0400, Rick Macklem wrote: > I've been doing a little more testing of "umount -f" for NFS > mounts and they seem to be working unless some other process/thread > has busied the file system via vfs_busy(). >=20 > Unfortunately, it is pretty easy to vfs_busy() the file system > by using a command like "df" that is stuck on the unresponsive > NFS server. >=20 > The problem seems to be that dounmount() msleep()s while > mnt_lockref !=3D 0 before calling VFS_UNMOUNT(). >=20 > If some call into the NFS client was done before this > while (mp->mnt_lockref) loop with msleep() in it, it > can easily kill off RPCs in progress. (It currently > does this in nfs_unmount() using the newnfs_nmcancelreqs() > call. >=20 > In summary: > - Would it be appropriate to add a new vfs_XXX method that > dounmount() would call before the while() loop for the > forced dismount case? > (The default would be a no-op and I have no idea if any > file system other than NFS would have a use for it?) > Alternately, there could be a function pointer set non-NULL > that would specifically be used by the NFS client for this. > This would avoid adding a vfs_XXX() method, but would mean > an NFS specific call ends up in the generic dounmount() code. >=20 > Anyone have comments on this? >=20 Yes, I do. I agree with adding the pre-unmount vfs method. This seems to be the cleanest solution possible. --huwNgOI5TI5AwA3T Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSHpwvAAoJEJDCuSvBvK1Bu9EP/i4ulJS03WTiV8Nu2rQJWFgM EXOJco5g/AeUjDIi0xo+Wk1BTfErnHIWFv7erCeDULtLEu4rj5zq4vOSbqPrqW9w mgD4J6FOuqda4rdMtWZYq/lwaXYGiKcu6frxtVxsag1yhZwjaZzavyBK7EburagX utVEOcizXXQtiL0ZgRoeyVejVAyJYt7xz/032+nghc9WKp0Zc0fyC2TWOiIsmHRq h09J9iYIL0mxj2r7mM6GiHaclPrl9q2e/wYV1Civ117NYI/E2G/z4CwW9/gtpFnM qnsaNHWbKJFfJGwMpfG4icLgwXbBgsmH0TI4lBKx9yk/sRaIDNmLrvpBwoQxZADH 8JsU+K8sV17ESnHnSKNWFvwWi69+BYl3eNE1EGo4nYZOD1AusP951xt3hU9Qd8d+ uTsD6KMnjlOS4L6Gnii1Gp4N00eaJHjO21Zj++CtYhfF24/i73zrutzD2axo2hAf tK9o37V5/Urnoa1pDuJLn/CI51XdbnesVma7mkQlTl6rDFdF8LPxfE/1QarxDl6w GVw+4oLYpA3RREiKvre8Te9tN6lY+9CPV87JOefb/Fo9aS/bwphcdyNxCmh4FnAk baLvf+27PzIqMBA2EV/pOAFCdFBWPH1QwSjeAIbFUGVjtBVWftWWxDQT72n2IgtV uICNAIQEMfYfXUcDh3at =RcCt -----END PGP SIGNATURE----- --huwNgOI5TI5AwA3T--