From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 01:00:22 2010 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 75CEA1065679; Tue, 27 Apr 2010 01:00:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650D08FC22; Tue, 27 Apr 2010 01:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3R10MER052420; Tue, 27 Apr 2010 01:00:22 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R10MPe052418; Tue, 27 Apr 2010 01:00:22 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004270100.o3R10MPe052418@svn.freebsd.org> From: Rick Macklem Date: Tue, 27 Apr 2010 01:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207256 - stable/8/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: Tue, 27 Apr 2010 01:00:22 -0000 Author: rmacklem Date: Tue Apr 27 01:00:22 2010 New Revision: 207256 URL: http://svn.freebsd.org/changeset/base/207256 Log: MFC: r206880 For the experimental NFS client doing an NFSv4 mount, set the NFSCLFLAGS_RECVRINPROG while doing recovery from an expired lease in a manner similar to r206818 for server reboot recovery. This will prevent the function that acquires stateids for I/O operations from acquiring out of date stateids during recovery. Also, fix up mutex locking on the nfsc_flags field. Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Tue Apr 27 00:58:19 2010 (r207255) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Tue Apr 27 01:00:22 2010 (r207256) @@ -2111,6 +2111,7 @@ nfscl_hasexpired(struct nfsclclient *clp NFSUNLOCKCLSTATE(); return (0); } + clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG; NFSUNLOCKCLSTATE(); nmp = clp->nfsc_nmp; @@ -2127,6 +2128,7 @@ nfscl_hasexpired(struct nfsclclient *clp * Clear out any state. */ nfscl_cleanclient(clp); + NFSLOCKCLSTATE(); clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | NFSCLFLAGS_RECOVER); } else { @@ -2140,14 +2142,15 @@ nfscl_hasexpired(struct nfsclclient *clp * Expire the state for the client. */ nfscl_expireclient(clp, nmp, cred, p); + NFSLOCKCLSTATE(); clp->nfsc_flags |= NFSCLFLAGS_HASCLIENTID; clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER; } - NFSFREECRED(cred); - clp->nfsc_flags &= ~NFSCLFLAGS_EXPIREIT; - NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~(NFSCLFLAGS_EXPIREIT | NFSCLFLAGS_RECVRINPROG); + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); + NFSFREECRED(cred); return (error); }