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.
Change-Id: I1389b0a45d3f8ff548f6400c66b30a69bafb4f39
Signed-off-by: Wally Wang <wang@cray.com>
Reviewed-on: http://review.whamcloud.com/989
Tested-by: Hudson
Reviewed-by: Cory Spitz <spitzcor@cray.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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;
}