From: Bobi Jam Date: Fri, 1 Dec 2017 01:56:47 +0000 (+0800) Subject: LU-10297 lod: prepare inuse array always X-Git-Tag: 2.10.56~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2cca16ba7da4070c319cc6230b7dbb3e7a91e323;p=fs%2Flustre-release.git LU-10297 lod: prepare inuse array always 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 Change-Id: Ibb37b680c68f8883650cdee6bebebc1c4d844623 Reviewed-on: https://review.whamcloud.com/30334 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 17abe3c..0fbde9f 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -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