From: Thomas Bertschinger Date: Fri, 7 Jul 2023 14:57:40 +0000 (-0400) Subject: LU-16872 lod: reset llc_ostlist when using O_APPEND stripes X-Git-Tag: 2.15.58~115 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=766b35a9700f36aa08b652fa9d18b890d34bf4a5;p=fs%2Flustre-release.git LU-16872 lod: reset llc_ostlist when using O_APPEND stripes Files created with O_APPEND can have special striping set with the parameters mdd.*.append_stripe_count and mdd.*.append_pool, and should not inherit a list of OSTs to use from a parent directory when these parameters are set. However, if a file is created with O_APPEND and its create is handled by a kernel thread that has previously created a file with a default list of OSTs, then those defaults were erroneously applied to the O_APPEND file. This can lead to the create returning EINVAL or to a crash. This commit ensures that llc_ostlist is cleared when a file is created with special append stripes. Signed-off-by: Thomas Bertschinger Change-Id: Ib2023e17c9ef31a2e029e09e67b257eb2c77b113 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51559 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 8a144e0..e6b4227 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -5418,9 +5418,9 @@ static int lod_get_default_lov_striping(const struct lu_env *env, lod_set_pool(&llc->llc_pool, pool); - if (append_stripe_count != 0 || append_pool != NULL) { - /* Ignore specific striping for append. */ - } else if (v1->lmm_magic == LOV_USER_MAGIC_SPECIFIC) { + if (v1->lmm_magic == LOV_USER_MAGIC_SPECIFIC && + append_stripe_count == 0 && + append_pool == NULL) { v3 = (struct lov_user_md_v3 *)v1; rc = lod_comp_copy_ost_lists(llc, v3); if (rc)