Whamcloud - gitweb
LU-9679 llite: fix possible race with module unload.
[fs/lustre-release.git] / lnet / lnet / lib-md.c
index 9bf890c..c1c1192 100644 (file)
@@ -335,6 +335,10 @@ lnet_md_validate(struct lnet_md *umd)
                CERROR("Invalid option: too many fragments %u, %d max\n",
                       umd->length, LNET_MAX_IOV);
                return -EINVAL;
+       } else if (umd->length > LNET_MTU) {
+               CERROR("Invalid length: too big fragment size %u, %d max\n",
+                      umd->length, LNET_MTU);
+               return -EINVAL;
        }
 
        return 0;
@@ -369,8 +373,8 @@ int
 LNetMDAttach(struct lnet_handle_me meh, struct lnet_md umd,
             enum lnet_unlink unlink, struct lnet_handle_md *handle)
 {
-       struct list_head        matches = LIST_HEAD_INIT(matches);
-       struct list_head        drops = LIST_HEAD_INIT(drops);
+       LIST_HEAD(matches);
+       LIST_HEAD(drops);
        struct lnet_me          *me;
        struct lnet_libmd       *md;
        int                     cpt;