From owner-svn-src-all@FreeBSD.ORG Mon Apr 18 08:01:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FCD1065674; Mon, 18 Apr 2011 08:01:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EFF848FC13; Mon, 18 Apr 2011 08:01:25 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3I81Hn5076815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Apr 2011 11:01:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p3I81GgK032569; Mon, 18 Apr 2011 11:01:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3I81GfE032568; Mon, 18 Apr 2011 11:01:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 18 Apr 2011 11:01:16 +0300 From: Kostik Belousov To: Rick Macklem Message-ID: <20110418080116.GW48734@deviant.kiev.zoral.com.ua> References: <201104172304.p3HN44mq052335@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="szdyR02yM8NCQUEm" Content-Disposition: inline In-Reply-To: <201104172304.p3HN44mq052335@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220761 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 18 Apr 2011 08:01:26 -0000 --szdyR02yM8NCQUEm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 17, 2011 at 11:04:04PM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Sun Apr 17 23:04:03 2011 > New Revision: 220761 > URL: http://svn.freebsd.org/changeset/base/220761 >=20 > Log: > Add checks for MNTK_UNMOUNTF at the beginning of three > functions, so that threads don't get stuck in them during > a forced dismount. nfs_sync/VFS_SYNC() needs this, since it is > called by dounmount() before VFS_UNMOUNT(). The nfscl_nget() > case makes sure that a thread doing an VOP_OPEN() or > VOP_ADVLOCK() call doesn't get blocked before attempting > the RPC. Attempting RPCs don't block, since they all > fail once a forced dismount is in progress. > The third one at the beginning of nfsrpc_close() > is done so threads don't get blocked while doing VOP_INACTIVE() > as the vnodes are cleared out. > With these three changes plus a change to the umount(1) > command so that it doesn't do "sync()" for the forced case > seem to make forced dismounts work for the experimental NFS > client. > =20 > MFC after: 2 weeks >=20 > Modified: > head/sys/fs/nfsclient/nfs_clrpcops.c > head/sys/fs/nfsclient/nfs_clstate.c > head/sys/fs/nfsclient/nfs_clvfsops.c >=20 > Modified: head/sys/fs/nfsclient/nfs_clrpcops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 17 22:31:36 2011 (r22076= 0) > +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 17 23:04:03 2011 (r22076= 1) > @@ -567,6 +567,11 @@ nfsrpc_close(vnode_t vp, int doclose, NF > =20 > if (vnode_vtype(vp) !=3D VREG) > return (0); > + > + /* For forced unmounts, just return. */ > + if ((vp->v_mount->mnt_kern_flag & MNTK_UNMOUNTF) !=3D 0) > + return (0); > + Is there anything that would prevent the MNTK_UNMOUNTF flag from being set immediately after the test returned success ? Usually, the tests for MNTK_UNMOUNTF are bugs. I coould see how terminating the RPCs would be useful for forced unmounts, but do not think that preventing entry into close would help. > if (doclose) > error =3D nfscl_doclose(vp, &clp, p); > else >=20 --szdyR02yM8NCQUEm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2r78wACgkQC3+MBN1Mb4hKTQCg8IKS2khsSP6wDZDpptqWZhkw 2hoAn1rlDJiQyIzoLbPbArJ82JAxwg/S =XNcI -----END PGP SIGNATURE----- --szdyR02yM8NCQUEm--