nfsd4: BUG_ON(!is_spin_locked()) no good on UP kernels
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 12 Jun 2012 12:28:48 +0000 (08:28 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 14 Jun 2012 17:54:08 +0000 (13:54 -0400)
Most frequent symptom was a BUG triggering in expire_client, with the
server locking up shortly thereafter.

Introduced by 508dc6e110c6dbdc0bbe84298ccfe22de7538486 "nfsd41:
free_session/free_client must be called under the client_lock".

Cc: stable@kernel.org
Cc: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 8fdc9ec5c5d359f8defb2766e710eb35fc08c3b0..94effd5bc4a107086ef53515ac2bb9dc39950b88 100644 (file)
@@ -900,7 +900,7 @@ static void free_session(struct kref *kref)
        struct nfsd4_session *ses;
        int mem;
 
-       BUG_ON(!spin_is_locked(&client_lock));
+       lockdep_assert_held(&client_lock);
        ses = container_of(kref, struct nfsd4_session, se_ref);
        nfsd4_del_conns(ses);
        spin_lock(&nfsd_drc_lock);
@@ -1080,7 +1080,7 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
 static inline void
 free_client(struct nfs4_client *clp)
 {
-       BUG_ON(!spin_is_locked(&client_lock));
+       lockdep_assert_held(&client_lock);
        while (!list_empty(&clp->cl_sessions)) {
                struct nfsd4_session *ses;
                ses = list_entry(clp->cl_sessions.next, struct nfsd4_session,