Whamcloud - gitweb
LU-6071 client: Fix mkdir -i 1 from DNE2 client to DNE1 server 89/13189/3
authorArtem Blagodarenko <artem_blagodarenko@xyratex.com>
Mon, 29 Dec 2014 11:32:51 +0000 (14:32 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 22 Jan 2015 20:05:40 +0000 (20:05 +0000)
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 <artem_blagodarenko@xyratex.com>
Xyratex-bug-id: MRP-2319
Change-Id: I837a7ac144bf4aaf5039c55d03cabc0cd9847faa
Reviewed-on: http://review.whamcloud.com/13189
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lmv/lmv_obd.c

index 582b7d0..69a2a3f 100644 (file)
@@ -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);