From 080d36e87a8acc25b5d9dce4a028828879c1f4cf Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Fri, 17 Dec 2010 03:09:07 +0300 Subject: [PATCH] b=23157 do not crash on wrong network message in filter_connect_internal --- lustre/obdfilter/filter.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 3dbd107..79a268d 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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) { -- 1.8.3.1