From: adilger Date: Mon, 3 Nov 2003 22:57:30 +0000 (+0000) Subject: Print a more useful error if we have problems cleaning up the portals slabs. X-Git-Tag: v1_7_0_51~2^7~308 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c3d0469133edae27e50cb1b5358ef19a448b84e1;p=fs%2Flustre-release.git Print a more useful error if we have problems cleaning up the portals slabs. I don't know why this would fail (we check refcounts above), but it did. --- diff --git a/lnet/lnet/lib-init.c b/lnet/lnet/lib-init.c index 99c4d32..ab223d6 100644 --- a/lnet/lnet/lib-init.c +++ b/lnet/lnet/lib-init.c @@ -127,6 +127,8 @@ kportal_descriptor_setup (nal_cb_t *nal) void kportal_descriptor_cleanup (nal_cb_t *nal) { + int rc; + if (--ptl_slab_users != 0) return; @@ -135,14 +137,26 @@ kportal_descriptor_cleanup (nal_cb_t *nal) LASSERT (atomic_read (&eq_in_use_count) == 0); LASSERT (atomic_read (&msg_in_use_count) == 0); - if (ptl_md_slab != NULL) - kmem_cache_destroy(ptl_md_slab); - if (ptl_msg_slab != NULL) - kmem_cache_destroy(ptl_msg_slab); - if (ptl_me_slab != NULL) - kmem_cache_destroy(ptl_me_slab); - if (ptl_eq_slab != NULL) - kmem_cache_destroy(ptl_eq_slab); + if (ptl_md_slab != NULL) { + rc = kmem_cache_destroy(ptl_md_slab); + if (rc != 0) + CERROR("unable to free MD slab\n"); + } + if (ptl_msg_slab != NULL) { + rc = kmem_cache_destroy(ptl_msg_slab); + if (rc != 0) + CERROR("unable to free MSG slab\n"); + } + if (ptl_me_slab != NULL) { + rc = kmem_cache_destroy(ptl_me_slab); + if (rc != 0) + CERROR("unable to free ME slab\n"); + } + if (ptl_eq_slab != NULL) { + rc = kmem_cache_destroy(ptl_eq_slab); + if (rc != 0) + CERROR("unable to free EQ slab\n"); + } } #else diff --git a/lustre/portals/portals/lib-init.c b/lustre/portals/portals/lib-init.c index 99c4d32..ab223d6 100644 --- a/lustre/portals/portals/lib-init.c +++ b/lustre/portals/portals/lib-init.c @@ -127,6 +127,8 @@ kportal_descriptor_setup (nal_cb_t *nal) void kportal_descriptor_cleanup (nal_cb_t *nal) { + int rc; + if (--ptl_slab_users != 0) return; @@ -135,14 +137,26 @@ kportal_descriptor_cleanup (nal_cb_t *nal) LASSERT (atomic_read (&eq_in_use_count) == 0); LASSERT (atomic_read (&msg_in_use_count) == 0); - if (ptl_md_slab != NULL) - kmem_cache_destroy(ptl_md_slab); - if (ptl_msg_slab != NULL) - kmem_cache_destroy(ptl_msg_slab); - if (ptl_me_slab != NULL) - kmem_cache_destroy(ptl_me_slab); - if (ptl_eq_slab != NULL) - kmem_cache_destroy(ptl_eq_slab); + if (ptl_md_slab != NULL) { + rc = kmem_cache_destroy(ptl_md_slab); + if (rc != 0) + CERROR("unable to free MD slab\n"); + } + if (ptl_msg_slab != NULL) { + rc = kmem_cache_destroy(ptl_msg_slab); + if (rc != 0) + CERROR("unable to free MSG slab\n"); + } + if (ptl_me_slab != NULL) { + rc = kmem_cache_destroy(ptl_me_slab); + if (rc != 0) + CERROR("unable to free ME slab\n"); + } + if (ptl_eq_slab != NULL) { + rc = kmem_cache_destroy(ptl_eq_slab); + if (rc != 0) + CERROR("unable to free EQ slab\n"); + } } #else