From dee2857e2250c1c1af9d34632087e4676218bcad Mon Sep 17 00:00:00 2001 From: Isaac Huang Date: Sun, 22 Jun 2014 21:32:22 -0400 Subject: staging/lustre/lnet: abort messages whose MD has been unlinked If LNetMDUnlink has been called, all outgoing messages on that MD should be aborted before lnet_ni_send() is called. Signed-off-by: Isaac Huang Reviewed-on: http://review.whamcloud.com/8041 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4006 Reviewed-by: Liang Zhen Reviewed-by: Doug Oucharek Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lnet/lnet/lib-md.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/staging/lustre/lnet/lnet/lib-md.c') diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index ae643f26933b..d68c6e0b4f16 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ -387,7 +387,8 @@ EXPORT_SYMBOL(LNetMDBind); /** * Unlink the memory descriptor from any ME it may be linked to and release - * the internal resources associated with it. + * the internal resources associated with it. As a result, active messages + * associated with the MD may get aborted. * * This function does not free the memory region associated with the MD; * i.e., the memory the user allocated for this MD. If the ME associated with @@ -433,12 +434,11 @@ LNetMDUnlink (lnet_handle_md_t mdh) return -ENOENT; } + md->md_flags |= LNET_MD_FLAG_ABORTED; /* If the MD is busy, lnet_md_unlink just marks it for deletion, and - * when the NAL is done, the completion event flags that the MD was + * when the LND is done, the completion event flags that the MD was * unlinked. Otherwise, we enqueue an event now... */ - - if (md->md_eq != NULL && - md->md_refcount == 0) { + if (md->md_eq != NULL && md->md_refcount == 0) { lnet_build_unlink_event(md, &ev); lnet_eq_enqueue_event(md->md_eq, &ev); } -- cgit v1.2.3-59-g8ed1b