Whamcloud - gitweb
LU-9311 pfl: shouldn't reprocess granted resent request 12/26612/2
authorBobi Jam <bobijam.xu@intel.com>
Mon, 10 Apr 2017 17:50:04 +0000 (01:50 +0800)
committerJinshan Xiong <jinshan.xiong@intel.com>
Tue, 18 Apr 2017 03:13:54 +0000 (03:13 +0000)
When the LOVEA buffer is bigger than the request reply buffer, the
client will resend the layout write intent RPC, and
mdt_layout_change() should not reprocess it since the 2nd process
will try to cancel the 1st granted CR lock, while client has not
get it granted yet because of the reply buffer shortage resend the
RPC.

This patch also adjusts some debug messages, makes dump_lsm() dump
uninstantiated component stripe info.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: If64531c53ab494c785ad11b4f71fd0f1b562d47d
Reviewed-on: https://review.whamcloud.com/26612
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
lustre/include/md_object.h
lustre/llite/vvp_io.c
lustre/lov/lov_ea.c
lustre/mdt/mdt_handler.c

index 41970de..d64d243 100644 (file)
@@ -451,10 +451,6 @@ static inline int mo_layout_change(const struct lu_env *env,
                                   struct layout_intent *layout,
                                   const struct lu_buf *buf)
 {
-       CDEBUG(D_INFO, "got layout change request from client: "
-              "opc:%u flags:%#x extent[%#llx,%#llx)\n",
-              layout->li_opc, layout->li_flags,
-              layout->li_start, layout->li_end);
        /* need instantiate objects which in the access range */
        LASSERT(m->mo_ops->moo_layout_change);
        return m->mo_ops->moo_layout_change(env, m, layout, buf);
index 3ca5dc3..809c4a0 100644 (file)
@@ -361,6 +361,9 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
                        end = cl_offset(io->ci_obj, index + 1);
                }
 
+               CDEBUG(D_VFSTRACE, DFID" type %d [%llx, %llx)\n",
+                      PFID(lu_object_fid(&obj->co_lu)), io->ci_type,
+                      start, end);
                rc = ll_layout_write_intent(inode, start, end);
                io->ci_result = rc;
                if (!rc)
index 04624a3..1315681 100644 (file)
@@ -516,7 +516,7 @@ void dump_lsm(unsigned int level, const struct lov_stripe_md *lsm)
                       lse->lsme_pool_name);
                if (!lsme_inited(lse) ||
                    lse->lsme_pattern & LOV_PATTERN_F_RELEASED)
-                       break;
+                       continue;
                for (j = 0; j < lse->lsme_stripe_count; j++) {
                        CDEBUG(level, "   oinfo:%p: ostid: "DOSTID
                               " ost idx: %d gen: %d\n",
index 657966d..2f323a0 100644 (file)
@@ -1246,6 +1246,10 @@ static int mdt_layout_change(struct mdt_thread_info *info,
        int rc;
        ENTRY;
 
+       CDEBUG(D_INFO, "got layout change request from client: "
+              "opc:%u flags:%#x extent[%#llx,%#llx)\n",
+              layout->li_opc, layout->li_flags,
+              layout->li_start, layout->li_end);
        if (layout->li_start >= layout->li_end) {
                CERROR("Recieved an invalid layout change range [%llu, %llu) "
                       "for "DFID"\n", layout->li_start, layout->li_end,
@@ -3560,6 +3564,14 @@ static int mdt_intent_layout(enum mdt_it_code opcode,
        if (layout_change) {
                struct lu_buf *buf = &info->mti_buf;
 
+               /**
+                * mdt_layout_change is a reint operation, when the request
+                * is resent, layout write shouldn't reprocess it again.
+                */
+               rc = mdt_check_resent(info, mdt_reconstruct_generic, lhc);
+               if (rc)
+                       GOTO(out_obj, rc = rc < 0 ? rc : 0);
+
                buf->lb_buf = NULL;
                buf->lb_len = 0;
                if (unlikely(req_is_replay(mdt_info_req(info)))) {