Whamcloud - gitweb
LU-2896 mgs: fix handling non IR targets.
authorAlexey Lyashkov <alexey_lyashkov@xyratex.com>
Mon, 4 Mar 2013 11:42:22 +0000 (13:42 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 7 Mar 2013 01:16:59 +0000 (20:16 -0500)
non IR targets don't know about extra command as have single
"register target" so we need to treat - none command
as register new target

Xyratex-bug-id: MRP-880
Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Change-Id: I22a8fd034772c9355d2d56a166fdf3766edec719
Reviewed-on: http://review.whamcloud.com/5574
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/mgs/mgs_handler.c

index f71cc48..4086200 100644 (file)
@@ -310,7 +310,11 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
 
         mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
 
 
         mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
 
-        opc = mti->mti_flags & LDD_F_OPC_MASK;
+       if (OCD_HAS_FLAG(&req->rq_export->exp_connect_data, IMP_RECOV))
+               opc = mti->mti_flags & LDD_F_OPC_MASK;
+       else
+               opc = LDD_F_OPC_REG;
+
         if (opc == LDD_F_OPC_READY) {
                 CDEBUG(D_MGS, "fs: %s index: %d is ready to reconnect.\n",
                        mti->mti_fsname, mti->mti_stripe_index);
         if (opc == LDD_F_OPC_READY) {
                 CDEBUG(D_MGS, "fs: %s index: %d is ready to reconnect.\n",
                        mti->mti_fsname, mti->mti_stripe_index);