From: Oleg Drokin Date: Mon, 2 Feb 2015 02:52:19 +0000 (-0500) Subject: staging/lustre/mdc: Initialize req in mdc_enqueue for !it case X-Git-Tag: fixes-v4.0-rc1~99^2~11 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=3a09f36efd8f0c5c5d968fbbbb0967121076a25b staging/lustre/mdc: Initialize req in mdc_enqueue for !it case Commit ab909585b813 ("staging: lustre: Cleanup variable declarations in mdc_enqueue()") broke Lustre flock handling introducing access to uninitialized req variable, leading to bizzare crash in a later call to __req_capsule_offset with invalid pill value. Set req to NULL just for this case as in all other cases req is explicitly initialized with request packing call. Signed-off-by: Oleg Drokin CC: Srikrishan Malik Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 8c9b4f5494e9..d1c224ecd2b7 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -828,6 +828,7 @@ resend: einfo->ei_type); policy = (ldlm_policy_data_t *)lmm; res_id.name[3] = LDLM_FLOCK; + req = NULL; } else if (it->it_op & IT_OPEN) { req = mdc_intent_open_pack(exp, it, op_data, lmm, lmmsize, einfo->ei_cbdata);