svn commit: r206880 - head/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Tue Apr 20 01:02:40 UTC 2010
Author: rmacklem
Date: Tue Apr 20 01:02:39 2010
New Revision: 206880
URL: http://svn.freebsd.org/changeset/base/206880
Log:
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.
MFC after: 1 week
Modified:
head/sys/fs/nfsclient/nfs_clstate.c
Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 19 23:40:46 2010 (r206879)
+++ head/sys/fs/nfsclient/nfs_clstate.c Tue Apr 20 01:02:39 2010 (r206880)
@@ -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);
}
More information about the svn-src-all
mailing list