Whamcloud - gitweb
LU-10297 lod: prepare inuse array always 34/30334/2
authorBobi Jam <bobijam.xu@intel.com>
Fri, 1 Dec 2017 01:56:47 +0000 (09:56 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Dec 2017 03:46:05 +0000 (03:46 +0000)
The OST inuse array should be prepared for composite files and for
plain files as well, since creating OST objects in both cases needs
to use it.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Ibb37b680c68f8883650cdee6bebebc1c4d844623
Reviewed-on: https://review.whamcloud.com/30334
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_qos.c

index 17abe3c..0fbde9f 100644 (file)
@@ -2245,8 +2245,7 @@ int lod_prepare_create(const struct lu_env *env, struct lod_object *lo,
 {
        struct lod_thread_info *info = lod_env_info(env);
        struct lod_device *d = lu2lod_dev(lod2lu_obj(lo)->lo_dev);
-       struct ost_pool inuse_osts = { 0 };
-       struct ost_pool *inuse = &inuse_osts;
+       struct ost_pool *inuse = &info->lti_inuse_osts;
        uint64_t size = 0;
        int i;
        int rc;
@@ -2275,13 +2274,10 @@ int lod_prepare_create(const struct lu_env *env, struct lod_object *lo,
        if (attr->la_valid & LA_SIZE)
                size = attr->la_size;
 
-       /* only prepare inuse if multiple components to be created */
-       if (size && lo->ldo_is_composite) {
-               rc = lod_prepare_inuse(env, lo);
-               if (rc)
-                       RETURN(rc);
-               inuse = &info->lti_inuse_osts;
-       }
+       /* prepare inuse */
+       rc = lod_prepare_inuse(env, lo);
+       if (rc)
+               RETURN(rc);
 
        /**
         * prepare OST object creation for the component covering file's