From: Wang Di Date: Wed, 5 Nov 2014 18:46:59 +0000 (-0800) Subject: LU-5871 lod: Do not return EAGAIN in lod_object_init X-Git-Tag: 2.6.91~88 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F86%2F12586%2F4;p=fs%2Flustre-release.git LU-5871 lod: Do not return EAGAIN in lod_object_init Convert EAGAIN to EIO if fld_client_rpc() fails in lod_object_init(), otherwise it will confuse lu_object_find_at(), and make it wait there for no reason, which should only wait if the object is dying. See call chain lu_object_find_at()-> lu_object_find_try() ->lu_object_alloc()->lod_object_init()->lod_fld_lookup() ->fld_client_rpc(), and even worse waitq is not being initialized yet when the failure happened here. Change-Id: Ieae434b34c239efea86a4a471fb01e397336a31c Signed-off-by: Wang Di Reviewed-on: http://review.whamcloud.com/12586 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 8c2c8d1..4cb4d06 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -3984,8 +3984,16 @@ static int lod_object_init(const struct lu_env *env, struct lu_object *lo, ENTRY; rc = lod_fld_lookup(env, lod, lu_object_fid(lo), &idx, &type); - if (rc != 0) + if (rc != 0) { + /* Note: Sometimes, it will Return EAGAIN here, see + * ptrlpc_import_delay_req(), which might confuse + * lu_object_find_at() and make it wait there incorrectly. + * so we convert it to EIO here.*/ + if (rc == -EAGAIN) + rc = -EIO; + RETURN(rc); + } if (type == LU_SEQ_RANGE_MDT && idx == lu_site2seq(lo->lo_dev->ld_site)->ss_node_id) {