When setstripe -d is run on a directory, we should
clear the OST pool along with all the other settings
Currently there is no way to clear an OST pool,
only change them.
This patch is back-ported from the following one:
Lustre-commit:
37f6357a5c9f4ad0e2269529e7001f5ab63689a5
Lustre-change: https://review.whamcloud.com/31364
Signed-off-by: Ben Evans <bevans@cray.com>
Cray-bug-id: LUS-5696
Change-Id: I50426ce79ab153a715d29cc5d54b0ce70726da41
Reviewed-on: https://review.whamcloud.com/33742
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
struct lod_default_striping *lds = &info->lti_def_striping;
struct lov_user_md_v1 *v1 = buf->lb_buf;
char pool[LOV_MAXPOOLNAME + 1];
+ bool is_del;
/* get existing striping config */
rc = lod_get_default_lov_striping(env, lod_dt_obj(dt), lds);
lds->lds_def_comp_cnt, pool,
sizeof(pool));
+ is_del = LOVEA_DELETE_VALUES(v1->lmm_stripe_size,
+ v1->lmm_stripe_count,
+ v1->lmm_stripe_offset,
+ NULL);
+
/* Retain the pool name if it is not given */
- if (v1->lmm_magic == LOV_USER_MAGIC_V1 && pool[0] != '\0') {
+ if (v1->lmm_magic == LOV_USER_MAGIC_V1 && pool[0] != '\0' &&
+ !is_del) {
struct lod_thread_info *info = lod_env_info(env);
struct lov_user_md_v3 *v3 = info->lti_ea_store;
}
run_test 27F "Client resend delayed layout creation with non-zero size"
+test_27G() { #LU-10629
+ [ -n "$FILESET" ] && skip "SKIP due to FILESET set" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ local POOL=${POOL:-testpool}
+ local ostrange="0 0 1"
+
+ test_mkdir $DIR/$tdir
+ pool_add $POOL || error "pool_add failed"
+ pool_add_targets $POOL $ostrange || error "pool_add_targets failed"
+ $LFS setstripe -p $POOL $DIR/$tdir
+
+ local pool=$($LFS getstripe -p $DIR/$tdir)
+
+ [ "$pool" = "$POOL" ] || error "Striping failed got '$pool' not '$POOL'"
+
+ $LFS setstripe -d $DIR/$tdir
+
+ pool=$($LFS getstripe -p $DIR/$tdir)
+
+ rmdir $DIR/$tdir
+
+ [ -z "$pool" ] || error "'$pool' is not empty"
+}
+run_test 27G "Clear OST pool from stripe"
+
# createtest also checks that device nodes are created and
# then visible correctly (#2091)
test_28() { # bug 2091
local fsname=${1%%.*}
local poolname=${1##$fsname.}
- trap "destroy_test_pools $fsname" EXIT
+ stack_trap "destroy_test_pools $fsname" EXIT
do_facet mgs lctl pool_new $1
local RC=$?
# get param should return err unless pool is created