From: Artem Blagodarenko Date: Tue, 17 Dec 2019 09:12:36 +0000 (+0300) Subject: LU-13070 mdd: try old format for orphan names during recovery X-Git-Tag: 2.12.4-RC1~17 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b75f04d5855d7ac4de98fe89686ae685c19c2f97;p=fs%2Flustre-release.git LU-13070 mdd: try old format for orphan names during recovery mdd_orphan_destroy() loop caused by compatibility issue on upgrade to 2.11 or later. The format for names of orphans in the PENDING directory was changed in Lustre 2.11. The old format names are not recognized by mdd_orphan_destroy() in Lustre 2.11, but compatibility code added to handle this was incomplete, leading to an endless loop. There's a check for the old format name, used in mdd_orphan_delete(), but that check was not included in mdd_orphan_destroy(). This patch adds compatibility check for mdd_orphan_destroy(). Lustre-change: https://review.whamcloud.com/37049 Lustre-commit: 05fca4be33067f24a02e527c88cff5b60a20bb39 Fixes: a02fd4573fe ("LU-7787 mdd: clean up orphan object handling") Signed-off-by: Artem Blagodarenko Cray-bug-id: LUS-8270 Change-Id: I9f42188dcb00f9d536996c14771de7df02502b40 Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Yang Sheng Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/37129 Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/mdd/mdd_orphans.c b/lustre/mdd/mdd_orphans.c index 2de5baa..1278369 100644 --- a/lustre/mdd/mdd_orphans.c +++ b/lustre/mdd/mdd_orphans.c @@ -323,6 +323,10 @@ static int mdd_orphan_destroy(const struct lu_env *env, struct mdd_object *obj, if (likely(obj->mod_count == 0)) { dt_write_lock(env, mdd->mdd_orphans, MOR_TGT_ORPHAN); rc = dt_delete(env, mdd->mdd_orphans, key, th); + if (rc == -ENOENT) { + key = mdd_orphan_key_fill_20(env, mdo2fid(obj)); + rc = dt_delete(env, mdd->mdd_orphans, key, th); + } if (rc) { CERROR("%s: could not delete orphan "DFID": rc = %d\n", mdd2obd_dev(mdd)->obd_name, PFID(mdo2fid(obj)),