X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdecho%2Fecho_client.c;h=cd56684ce4a9d73090736b5d540c4042878debc3;hp=9eba69e74bc4e6f9dc5fd0074dcea8d9d44bec5f;hb=c965680bf2b891a5372b994e685848fd8f0e255a;hpb=f2a9374170e4522b9d2ac3b7096cf2912339d480 diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 9eba69e..cd56684 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -296,7 +296,9 @@ static void echo_page_discard(const struct lu_env *env, static int echo_page_is_vmlocked(const struct lu_env *env, const struct cl_page_slice *slice) { - return cfs_mutex_is_locked(&cl2echo_page(slice)->ep_lock); + if (cfs_mutex_is_locked(&cl2echo_page(slice)->ep_lock)) + return -EBUSY; + return -ENODATA; } static void echo_page_completion(const struct lu_env *env, @@ -2104,10 +2106,16 @@ int echo_client_init(void) int rc; lprocfs_echo_init_vars(&lvars); - rc = class_register_type(&echo_obd_ops, NULL, lvars.module_vars, - LUSTRE_ECHO_CLIENT_NAME, &echo_device_type); - if (rc == 0) - lu_kmem_init(echo_caches); + + rc = lu_kmem_init(echo_caches); + if (rc == 0) { + rc = class_register_type(&echo_obd_ops, NULL, + lvars.module_vars, + LUSTRE_ECHO_CLIENT_NAME, + &echo_device_type); + if (rc) + lu_kmem_fini(echo_caches); + } return rc; }