From: John L. Hammond Date: Tue, 27 Aug 2013 18:00:40 +0000 (-0500) Subject: LU-3842 hsm: handle NULL crh in hsm_cdt_request_completed() X-Git-Tag: 2.4.92~33 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=21c12a785a5dd2328e7f1f7d8599af8ad7dfe2c3 LU-3842 hsm: handle NULL crh in hsm_cdt_request_completed() In hsm_cdt_request_completed() if a restore handle could not be found, don't dereference the NULL crh returned by hsm_restore_hdl_find(). Signed-off-by: John L. Hammond Change-Id: I175f506d0acdecfef36352638bda2ada66d182db Reviewed-on: http://review.whamcloud.com/7470 Tested-by: Hudson Tested-by: Maloo Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index 66df716..8bc120a 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -1368,8 +1368,9 @@ unlock: /* just give back layout lock, we keep * the reference which is given back * later with the lock for HSM flags */ - if (!IS_ERR(obj)) + if (!IS_ERR(obj) && crh != NULL) mdt_object_unlock(mti, obj, &crh->crh_lh, 1); + if (crh != NULL) OBD_SLAB_FREE_PTR(crh, mdt_hsm_cdt_kmem); }