Whamcloud - gitweb
b=23157 do not crash on wrong network message in filter_connect_internal
authorBernd Schubert <bschubert@ddn.com>
Fri, 17 Dec 2010 00:09:07 +0000 (03:09 +0300)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Fri, 17 Dec 2010 00:09:07 +0000 (03:09 +0300)
lustre/obdfilter/filter.c

index 3dbd107..79a268d 100644 (file)
@@ -2380,7 +2380,17 @@ static int filter_connect_internal(struct obd_export *exp,
                 data->ocd_brw_size = min(data->ocd_brw_size,
                                          (__u32)(PTLRPC_MAX_BRW_PAGES <<
                                                  CFS_PAGE_SHIFT));
-                LASSERT(data->ocd_brw_size);
+                if (data->ocd_brw_size == 0) {
+                        CERROR("%s: cli %s/%p ocd_connect_flags: "LPX64
+                               " ocd_version: %x ocd_grant: %d ocd_index: %u "
+                               "ocd_brw_size is unexpectedly zero, "
+                               "network data corruption?"
+                               "Refusing connection of this client\n",
+                                exp->exp_obd->obd_name, exp->exp_client_uuid.uuid,
+                                exp, data->ocd_connect_flags, data->ocd_version,
+                                data->ocd_grant, data->ocd_index);
+                        RETURN(-EPROTO);
+                }
         }
 
         if (data->ocd_connect_flags & OBD_CONNECT_CKSUM) {