Whamcloud - gitweb
LU-443 LNet: Only squawk when md->start is NULL on non-zero length 13/1413/2
authorWally Wang <wang@cray.com>
Thu, 22 Sep 2011 22:58:05 +0000 (15:58 -0700)
committerJohann Lombardi <johann@whamcloud.com>
Mon, 10 Oct 2011 21:43:16 +0000 (23:43 +0200)
Only squawk when md->start is NULL on non-zero length.
The md->start == NULL check prevents anyone from creating a ME/MD
with no buffer. These are used as backstop buffers to generate events
when traffic has exceeded the local buffer space.
See Oracle bug 21103 attachment 32922.

Change-Id: Id4fdf26b047df56cdf034952fea15f9a4e0dba62
Signed-off-by: Wally Wang <wang@cray.com>
lnet/lnet/lib-md.c

index 7f441aa..85ef925 100644 (file)
@@ -215,8 +215,9 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 int
 lnet_md_validate(lnet_md_t *umd)
 {
-        if (umd->start == NULL) {
-                CERROR("MD start pointer can not be NULL\n");
+        if (umd->start == NULL && umd->length != 0) {
+                CERROR("MD start pointer can not be NULL with length %u\n",
+                       umd->length);
                 return -EINVAL;
         }