X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fnrs.c;h=6d02aa522b629ccb2a90299cc207cf000d130878;hp=4a3c976a0c555f2839a9d693e6f13904cee00aa4;hb=7c3d518d72446846c27539c0886a847a78ed8235;hpb=6e270587e4a49fa1cd35e26e3af438b6511393e5 diff --git a/lustre/ptlrpc/nrs.c b/lustre/ptlrpc/nrs.c index 4a3c976..6d02aa52 100644 --- a/lustre/ptlrpc/nrs.c +++ b/lustre/ptlrpc/nrs.c @@ -1019,7 +1019,13 @@ static void nrs_svcpt_cleanup_locked(struct ptlrpc_service_part *svcpt) LASSERT(mutex_is_locked(&nrs_core.nrs_mutex)); again: - nrs = nrs_svcpt2nrs(svcpt, hp); + /* scp_nrs_hp could be NULL due to short of memory. */ + nrs = hp ? svcpt->scp_nrs_hp : &svcpt->scp_nrs_reg; + /* check the nrs_svcpt to see if nrs is initialized. */ + if (!nrs || !nrs->nrs_svcpt) { + EXIT; + return; + } nrs->nrs_stopping = 1; cfs_list_for_each_entry_safe(policy, tmp, &nrs->nrs_policy_list,