aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfs
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2010-04-15 22:57:30 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2010-04-15 22:57:30 +0000
commit55909abf07e4069f4c4e176c320dbec548dd60ab (patch)
tree3856375a54aca33c4f80c011377bffc54088ebb9 /sys/fs/nfs
parentc27b391b3f5fece33f763f040e229ed603e560bb (diff)
downloadsrc-55909abf07e4069f4c4e176c320dbec548dd60ab.tar.gz
src-55909abf07e4069f4c4e176c320dbec548dd60ab.zip
The experimental NFS client was not filling in recovery credentials
for opens done locally in the client when a delegation for the file was held. This could cause the client to crash in crsetgroups() when recovering from a server crash/reboot. This patch fills in the recovery credentials for this case, in order to avoid the client crash. Also, add KASSERT()s to the credential copy functions, to catch any other cases where the credentials aren't filled in correctly. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=206688
Diffstat (limited to 'sys/fs/nfs')
-rw-r--r--sys/fs/nfs/nfs_commonport.c2
-rw-r--r--sys/fs/nfs/nfsclstate.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c
index a65ebde881cb..2849163837df 100644
--- a/sys/fs/nfs/nfs_commonport.c
+++ b/sys/fs/nfs/nfs_commonport.c
@@ -225,6 +225,8 @@ void
newnfs_copycred(struct nfscred *nfscr, struct ucred *cr)
{
+ KASSERT(nfscr->nfsc_ngroups >= 0,
+ ("newnfs_copycred: negative nfsc_ngroups"));
cr->cr_uid = nfscr->nfsc_uid;
crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups);
}
diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h
index 10747af5a643..edd479cf2cee 100644
--- a/sys/fs/nfs/nfsclstate.h
+++ b/sys/fs/nfs/nfsclstate.h
@@ -140,6 +140,7 @@ struct nfsclopen {
#define NFSCLOPEN_OK 0
#define NFSCLOPEN_DOOPEN 1
#define NFSCLOPEN_DOOPENDOWNGRADE 2
+#define NFSCLOPEN_SETCRED 3
struct nfscllockowner {
LIST_ENTRY(nfscllockowner) nfsl_list;