From a19f706ebef23a5778572553256df78abb81e1a4 Mon Sep 17 00:00:00 2001 From: wangdi Date: Sat, 30 Nov 2013 01:44:28 -0800 Subject: [PATCH] LU-2801 mdt: checking remote object in mdt_swap_layouts It should use mdt_remote_object to check remote object in mdt_swap_layouts, instead of mdt_object_exists < 0. Send swap layout req to the right MDT. Signed-off-by: wang di Change-Id: Ia24635e16cb67e5683abc9797ec6c9e61f648c62 Reviewed-on: http://review.whamcloud.com/5332 Reviewed-by: Andreas Dilger Reviewed-by: Jinshan Xiong Reviewed-by: Alex Zhuravlev Tested-by: Hudson Tested-by: Maloo --- lustre/lmv/lmv_obd.c | 3 ++- lustre/mdt/mdt_handler.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 52055c6..4a5e147 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -865,7 +865,8 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, } case LL_IOC_HSM_STATE_GET: case LL_IOC_HSM_STATE_SET: - case LL_IOC_HSM_ACTION: { + case LL_IOC_HSM_ACTION: + case LL_IOC_LOV_SWAP_LAYOUTS: { struct md_op_data *op_data = karg; struct lmv_tgt_desc *tgt; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index e11d46b..fbdc694 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1046,7 +1046,7 @@ int mdt_swap_layouts(struct mdt_thread_info *info) if (IS_ERR(o)) GOTO(out, rc = PTR_ERR(o)); - if (mdt_object_exists(o) < 0) /* remote object */ + if (mdt_object_remote(o) || !mdt_object_exists(o)) /* remote object */ GOTO(put, rc = -ENOENT); rc = lu_fid_cmp(&info->mti_body->fid1, &info->mti_body->fid2); -- 1.8.3.1