From aaa6b54a34da23ea27154aba69f8c90210ae7784 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. Lustre-change: https://review.whamcloud.com/30334 Lustre-commit: 2cca16ba7da4070c319cc6230b7dbb3e7a91e323 Signed-off-by: Bobi Jam Change-Id: Ibb37b680c68f8883650cdee6bebebc1c4d844623 Reviewed-by: Fan Yong Reviewed-by: Jinshan Xiong Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/30486 Reviewed-by: Bobi Jam Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- 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 968392c..610233e 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -2220,8 +2220,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; @@ -2250,13 +2249,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