From 588a29ba81c6c59652e24831c177348f87ad489b Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 9 Jan 2014 13:09:49 -0600 Subject: [PATCH] LU-4462 mdt: don't apply mdt_object_fid() to ERR_PTRs In mdt_reconstruct_open(), mdt_reconstruct_create(), and mdt_reconstruct_setattr() print the FID from the request rather than applying mdt_object_fid() to a known ERR_PTR. Signed-off-by: John L. Hammond Change-Id: Ifb9365dbef1492d8fb5c7ff27d00f5155b0e7525 Reviewed-on: http://review.whamcloud.com/8788 Tested-by: Jenkins Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_open.c | 25 ++++++++++++------------ lustre/mdt/mdt_recovery.c | 48 +++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 85b7568..fc67526 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1085,18 +1085,19 @@ void mdt_reconstruct_open(struct mdt_thread_info *info, mdt_export_evict(exp); RETURN_EXIT; } - child = mdt_object_find(env, mdt, rr->rr_fid2); - if (IS_ERR(child)) { - rc = PTR_ERR(child); - LCONSOLE_WARN("Child "DFID" lookup error %d." - " Evicting client %s with export %s.\n", - PFID(mdt_object_fid(child)), rc, - obd_uuid2str(&exp->exp_client_uuid), - obd_export_nid2str(exp)); - mdt_object_put(env, parent); - mdt_export_evict(exp); - RETURN_EXIT; - } + + child = mdt_object_find(env, mdt, rr->rr_fid2); + if (IS_ERR(child)) { + rc = PTR_ERR(child); + LCONSOLE_WARN("cannot lookup child "DFID": rc = %d; " + "evicting client %s with export %s\n", + PFID(rr->rr_fid2), rc, + obd_uuid2str(&exp->exp_client_uuid), + obd_export_nid2str(exp)); + mdt_object_put(env, parent); + mdt_export_evict(exp); + RETURN_EXIT; + } if (unlikely(mdt_object_remote(child))) { /* the child object was created on remote server */ diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 56635af..fba53bf 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -249,19 +249,18 @@ static void mdt_reconstruct_create(struct mdt_thread_info *mti, if (req->rq_status) return; - /* if no error, so child was created with requested fid */ - child = mdt_object_find(mti->mti_env, mdt, mti->mti_rr.rr_fid2); - if (IS_ERR(child)) { - rc = PTR_ERR(child); - LCONSOLE_WARN("Child "DFID" lookup error %d." - " Evicting client %s with export %s.\n", - PFID(mdt_object_fid(child)), rc, - obd_uuid2str(&exp->exp_client_uuid), - obd_export_nid2str(exp)); - mdt_export_evict(exp); - EXIT; - return; - } + /* if no error, so child was created with requested fid */ + child = mdt_object_find(mti->mti_env, mdt, mti->mti_rr.rr_fid2); + if (IS_ERR(child)) { + rc = PTR_ERR(child); + LCONSOLE_WARN("cannot lookup child "DFID": rc = %d; " + "evicting client %s with export %s\n", + PFID(mti->mti_rr.rr_fid2), rc, + obd_uuid2str(&exp->exp_client_uuid), + obd_export_nid2str(exp)); + mdt_export_evict(exp); + RETURN_EXIT; + } body = req_capsule_server_get(mti->mti_pill, &RMF_MDT_BODY); mti->mti_attr.ma_need = MA_INODE; @@ -290,6 +289,7 @@ static void mdt_reconstruct_setattr(struct mdt_thread_info *mti, struct mdt_device *mdt = mti->mti_mdt; struct mdt_object *obj; struct mdt_body *body; + int rc; mdt_req_from_lcd(req, med->med_ted.ted_lcd); if (req->rq_status) @@ -297,17 +297,17 @@ static void mdt_reconstruct_setattr(struct mdt_thread_info *mti, body = req_capsule_server_get(mti->mti_pill, &RMF_MDT_BODY); obj = mdt_object_find(mti->mti_env, mdt, mti->mti_rr.rr_fid1); - if (IS_ERR(obj)) { - int rc = PTR_ERR(obj); - LCONSOLE_WARN(""DFID" lookup error %d." - " Evicting client %s with export %s.\n", - PFID(mdt_object_fid(obj)), rc, - obd_uuid2str(&exp->exp_client_uuid), - obd_export_nid2str(exp)); - mdt_export_evict(exp); - EXIT; - return; - } + if (IS_ERR(obj)) { + rc = PTR_ERR(obj); + LCONSOLE_WARN("cannot lookup "DFID": rc = %d; " + "evicting client %s with export %s\n", + PFID(mti->mti_rr.rr_fid1), rc, + obd_uuid2str(&exp->exp_client_uuid), + obd_export_nid2str(exp)); + mdt_export_evict(exp); + RETURN_EXIT; + } + mti->mti_attr.ma_need = MA_INODE; mti->mti_attr.ma_valid = 0; mdt_attr_get_complex(mti, obj, &mti->mti_attr); -- 1.8.3.1