patch-2.3.99-pre9 linux/net/sunrpc/auth.c

Next file: linux/net/unix/af_unix.c
Previous file: linux/net/ipv6/netfilter/ip6table_filter.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/net/sunrpc/auth.c linux/net/sunrpc/auth.c
@@ -84,6 +84,11 @@
 static inline void
 rpcauth_crdestroy(struct rpc_auth *auth, struct rpc_cred *cred)
 {
+#ifdef RPC_DEBUG
+	if (cred->cr_magic != RPCAUTH_CRED_MAGIC)
+		BUG();
+	cred->cr_magic = 0;
+#endif
 	if (auth->au_ops->crdestroy)
 		auth->au_ops->crdestroy(cred);
 	else
@@ -190,8 +195,13 @@
 	}
 	spin_unlock(&rpc_credcache_lock);
 
-	if (!cred)
+	if (!cred) {
 		cred = auth->au_ops->crcreate(taskflags);
+#ifdef RPC_DEBUG
+		if (cred)
+			cred->cr_magic = RPCAUTH_CRED_MAGIC;
+#endif
+	}
 
 	if (cred)
 		rpcauth_insert_credcache(auth, cred);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)