From 2cca16ba7da4070c319cc6230b7dbb3e7a91e323 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Fri, 1 Dec 2017 09:56:47 +0800 Subject: [PATCH] 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 --- lustre/lod/lod_qos.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 -- 1.8.3.1