Whamcloud - gitweb
LU-3242 obdclass: skip zero cookie in class_handle_hash()
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 29 Apr 2013 14:33:54 +0000 (09:33 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 1 May 2013 04:59:07 +0000 (00:59 -0400)
In class_handle_hash() really skip the zero cookie when it comes
around.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I042d7a43b70feb9710a7b3a27e732fc314ec1cf5
Reviewed-on: http://review.whamcloud.com/6198
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/lustre_handles.c

index 4d13acc..44ebea0 100644 (file)
@@ -89,7 +89,6 @@ void class_handle_hash(struct portals_handle *h,
        spin_lock(&handle_base_lock);
        handle_base += HANDLE_INCR;
 
-       h->h_cookie = handle_base;
        if (unlikely(handle_base == 0)) {
                /*
                 * Cookie of zero is "dangerous", because in many places it's
@@ -99,6 +98,7 @@ void class_handle_hash(struct portals_handle *h,
                CWARN("The universe has been exhausted: cookie wrap-around.\n");
                handle_base += HANDLE_INCR;
        }
+       h->h_cookie = handle_base;
        spin_unlock(&handle_base_lock);
 
        h->h_ops = ops;