Whamcloud - gitweb
LU-6744 lov: init LOV stripe type beforehand 62/15362/2
authorBobi Jam <bobijam.xu@intel.com>
Sat, 20 Jun 2015 03:07:39 +0000 (11:07 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 2 Jul 2015 18:12:21 +0000 (18:12 +0000)
When lu_object_alloc() reaches to LOV object init, we need initialize
its stripe type beforehand, so that if something wrong in the conf
buffer, the object chain need to be traversed to free what has been
allocated, with LOV object type be set as LLT_EMPTY, and when the LOV
part is reached, it won't panic without knowing what stripe type it
is.

This patch also improves debug messages in lsm_unpackmd_common(), and
does not return error if the LOV device is still processing config
log while trying to verify a layout buffer.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Ic814f89ebc960cc4c04835141d915f86c35ca39d
Reviewed-on: http://review.whamcloud.com/15362
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/lov/lov_ea.c
lustre/lov/lov_object.c

index f294d11..8ea8803 100644 (file)
@@ -181,17 +181,20 @@ static int lsm_unpackmd_common(struct lov_obd *lov,
                if (lov_oinfo_is_dummy(loi))
                        continue;
 
-               if (loi->loi_ost_idx >= lov->desc.ld_tgt_count) {
-                       CERROR("OST index %d more than OST count %d\n",
+               if (loi->loi_ost_idx >= lov->desc.ld_tgt_count &&
+                   !lov2obd(lov)->obd_process_conf) {
+                       CERROR("%s: OST index %d more than OST count %d\n",
+                              (char*)lov->desc.ld_uuid.uuid,
                               loi->loi_ost_idx, lov->desc.ld_tgt_count);
                        lov_dump_lmm_v1(D_WARNING, lmm);
                        return -EINVAL;
                }
 
-               if (!lov->lov_tgts[loi->loi_ost_idx]) {
-                       CERROR("OST index %d missing\n", loi->loi_ost_idx);
+               if (lov->lov_tgts[loi->loi_ost_idx] == NULL) {
+                       CERROR("%s: OST index %d missing\n",
+                              (char*)lov->desc.ld_uuid.uuid, loi->loi_ost_idx);
                        lov_dump_lmm_v1(D_WARNING, lmm);
-                       return -EINVAL;
+                       continue;
                }
 
                stripe_maxbytes = min_t(loff_t, stripe_maxbytes,
index a1fce2f..a23400f 100644 (file)
@@ -852,6 +852,7 @@ int lov_object_init(const struct lu_env *env, struct lu_object *obj,
        init_waitqueue_head(&lov->lo_waitq);
        cl_object_page_init(lu2cl(obj), sizeof(struct lov_page));
 
+       lov->lo_type = LLT_EMPTY;
        if (cconf->u.coc_layout.lb_buf != NULL) {
                lsm = lov_unpackmd(dev->ld_lov,
                                   cconf->u.coc_layout.lb_buf,