Whamcloud - gitweb
LU-17703 lod: check the inherited pool for conflicts
[fs/lustre-release.git] / lustre / lod / lod_object.c
index 6bccd97..3878d3b 100644 (file)
@@ -2721,8 +2721,10 @@ __u16 lod_comp_entry_stripe_count(struct lod_object *lo, int comp_idx,
        struct lod_layout_component *entry;
        enum lod_uses_hint flags = LOD_USES_ASSIGNED_STRIPE;
 
-       if (is_dir)
-               return  0;
+       if (is_dir) {
+               entry = &lo->ldo_def_striping->lds_def_comp_entries[comp_idx];
+               return entry->llc_ostlist.op_count;
+       }
 
        entry = &lo->ldo_comp_entries[comp_idx];
        if (lod_comp_inited(entry))
@@ -2781,6 +2783,8 @@ static int lod_comp_md_size(struct lod_object *lo, bool is_dir)
                        if (!is_dir && is_composite)
                                lod_comp_shrink_stripe_count(&comp_entries[i],
                                                             &stripe_count);
+                       if (is_dir && comp_entries[i].llc_ostlist.op_count)
+                               magic = LOV_MAGIC_SPECIFIC;
 
                        size += lov_user_md_size(stripe_count, magic);
                }
@@ -6042,7 +6046,7 @@ static void lod_ah_init(const struct lu_env *env,
                                lod_comp->llc_stripe_offset =
                                        def_comp->llc_stripe_offset;
                        if (lod_comp->llc_pool == NULL)
-                               lod_obj_set_pool(lc, 0, def_comp->llc_pool);
+                               lod_qos_set_pool(lc, 0, def_comp->llc_pool);
                }
        }
 out:
@@ -6067,7 +6071,7 @@ out:
                lod_adjust_stripe_info(lod_comp, desc,
                                       ah->dah_append_stripe_count);
                if (ah->dah_append_pool && ah->dah_append_pool[0])
-                       lod_obj_set_pool(lc, 0, ah->dah_append_pool);
+                       lod_qos_set_pool(lc, 0, ah->dah_append_pool);
        }
 
        EXIT;