- added more stringent parameter checks.
LASSERT (the_lnet.ln_init);
LASSERT (the_lnet.ln_refcount > 0);
LASSERT (the_lnet.ln_init);
LASSERT (the_lnet.ln_refcount > 0);
if ((umd.options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
umd.length > LNET_MAX_IOV) /* too many fragments */
return -EINVAL;
if ((umd.options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
umd.length > LNET_MAX_IOV) /* too many fragments */
return -EINVAL;
+ if ((umd.options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) == 0)
+ return -EINVAL;
+
md = lnet_md_alloc(&umd);
if (md == NULL)
return -ENOMEM;
md = lnet_md_alloc(&umd);
if (md == NULL)
return -ENOMEM;
LASSERT (the_lnet.ln_init);
LASSERT (the_lnet.ln_refcount > 0);
LASSERT (the_lnet.ln_init);
LASSERT (the_lnet.ln_refcount > 0);
if ((umd.options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
umd.length > LNET_MAX_IOV) /* too many fragments */
return -EINVAL;
if ((umd.options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
umd.length > LNET_MAX_IOV) /* too many fragments */
return -EINVAL;
+ if ((umd.options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) != 0)
+ return -EINVAL;
+
md = lnet_md_alloc(&umd);
if (md == NULL)
return -ENOMEM;
md = lnet_md_alloc(&umd);
if (md == NULL)
return -ENOMEM;
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.reply.dst_wmd);
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.reply.dst_wmd);
- if (md == NULL || md->md_threshold == 0) {
+ if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s for %s "
"MD "LPX64"."LPX64"\n",
libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
(md == NULL) ? "invalid" : "inactive",
hdr->msg.reply.dst_wmd.wh_interface_cookie,
hdr->msg.reply.dst_wmd.wh_object_cookie);
CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s for %s "
"MD "LPX64"."LPX64"\n",
libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
(md == NULL) ? "invalid" : "inactive",
hdr->msg.reply.dst_wmd.wh_interface_cookie,
hdr->msg.reply.dst_wmd.wh_object_cookie);
+ if (md != NULL && md->md_me != NULL)
+ CERROR("REPLY MD also attached to portal %d\n",
+ md->md_me->me_portal);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.ack.dst_wmd);
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.ack.dst_wmd);
- if (md == NULL || md->md_threshold == 0) {
+ if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
/* Don't moan; this is expected */
CDEBUG(D_NET,
"%s: Dropping ACK from %s to %s MD "LPX64"."LPX64"\n",
/* Don't moan; this is expected */
CDEBUG(D_NET,
"%s: Dropping ACK from %s to %s MD "LPX64"."LPX64"\n",
(md == NULL) ? "invalid" : "inactive",
hdr->msg.ack.dst_wmd.wh_interface_cookie,
hdr->msg.ack.dst_wmd.wh_object_cookie);
(md == NULL) ? "invalid" : "inactive",
hdr->msg.ack.dst_wmd.wh_interface_cookie,
hdr->msg.ack.dst_wmd.wh_object_cookie);
+ if (md != NULL && md->md_me != NULL)
+ CERROR("Source MD also attached to portal %d\n",
+ md->md_me->me_portal);
+
LNET_UNLOCK();
return ENOENT; /* +ve! */
}
LNET_UNLOCK();
return ENOENT; /* +ve! */
}
LNET_LOCK();
md = lnet_handle2md(&mdh);
LNET_LOCK();
md = lnet_handle2md(&mdh);
- if (md == NULL || md->md_threshold == 0) {
+ if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
- CERROR("Dropping PUT to %s: MD invalid\n",
- libcfs_id2str(target));
+ CERROR("Dropping PUT ("LPU64":%d:%s): MD (%d) invalid\n",
+ match_bits, portal, libcfs_id2str(target),
+ md == NULL ? -1 : md->md_threshold);
+ if (md != NULL && md->md_me != NULL)
+ CERROR("Source MD also attached to portal %d\n",
+ md->md_me->me_portal);
+
+ LNET_UNLOCK();
LNET_LOCK();
md = lnet_handle2md(&mdh);
LNET_LOCK();
md = lnet_handle2md(&mdh);
- if (md == NULL || md->md_threshold == 0) {
+ if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
- CERROR("Dropping GET to %s: MD invalid\n",
- libcfs_id2str(target));
+ CERROR("Dropping GET ("LPU64":%d:%s): MD (%d) invalid\n",
+ match_bits, portal, libcfs_id2str(target),
+ md == NULL ? -1 : md->md_threshold);
+ if (md != NULL && md->md_me != NULL)
+ CERROR("REPLY MD also attached to portal %d\n",
+ md->md_me->me_portal);
+
+ LNET_UNLOCK();