From: Artem Blagodarenko Date: Mon, 29 Dec 2014 11:32:51 +0000 (+0300) Subject: LU-6071 client: Fix mkdir -i 1 from DNE2 client to DNE1 server X-Git-Tag: 2.6.93~20 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=426f9c0365d1e8528b07b89f1d7c0a7f2f80e3a5 LU-6071 client: Fix mkdir -i 1 from DNE2 client to DNE1 server After DNE phase 2 has been added to client it sends create request to slave MDT. DNT1-only server doesn't expect request to slave MDT from client. It expects only cross-mdt request from master MDT. Thus if DNE2 client tries to "mkdir -i 1" on DNE1 server, then LBUG happened. This patch adds OBD_CONNECT_DIR_STRIPE connection flag check on client side. If striped directories are not supported by server, then create requrest is sent to master MDT. Signed-off-by: Artem Blagodarenko Xyratex-bug-id: MRP-2319 Change-Id: I837a7ac144bf4aaf5039c55d03cabc0cd9847faa Reviewed-on: http://review.whamcloud.com/13189 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 582b7d0..69a2a3f 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1817,14 +1817,17 @@ int lmv_create(struct obd_export *exp, struct md_op_data *op_data, rc = lmv_fid_alloc(NULL, exp, &op_data->op_fid2, op_data); if (rc) RETURN(rc); + if (exp_connect_flags(exp) & OBD_CONNECT_DIR_STRIPE) { + /* Send the create request to the MDT where the object + * will be located */ + tgt = lmv_find_target(lmv, &op_data->op_fid2); + if (IS_ERR(tgt)) + RETURN(PTR_ERR(tgt)); - /* Send the create request to the MDT where the object - * will be located */ - tgt = lmv_find_target(lmv, &op_data->op_fid2); - if (IS_ERR(tgt)) - RETURN(PTR_ERR(tgt)); - - op_data->op_mds = tgt->ltd_idx; + op_data->op_mds = tgt->ltd_idx; + } else { + CDEBUG(D_CONFIG, "Server doesn't support striped dirs\n"); + } CDEBUG(D_INODE, "CREATE obj "DFID" -> mds #%x\n", PFID(&op_data->op_fid2), op_data->op_mds);