From: Vitaly Fertman Date: Mon, 8 Jun 2020 20:24:12 +0000 (+0300) Subject: LU-13649 mdd: orhpan cleanup fix X-Git-Tag: 2.13.55~123 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=refs%2Fchanges%2F66%2F38866%2F2 LU-13649 mdd: orhpan cleanup fix due to a race with mdd_close() the objects may have been already destroyed by close and the 2nd destroy asserts on lu_object_is_dying() The problem appeared in LU-12846 which removed the error handling (ENOENT) returned by dt_delete - the entry was already removed from the parent. Fixes: 688d5da6a8 ("LU-12846 mdd: return error while delete failed") HPE-bug-id: LUS-8864 Signed-off-by: Vitaly Fertman Change-Id: I7e2f3fca7b7d4440340fd3daaf8ec528010d9117 Reviewed-by: Alexey Lyashkov Reviewed-by: Andriy Skulysh Tested-by: Alexander Lezhoev Reviewed-on: https://review.whamcloud.com/38866 Tested-by: jenkins Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdd/mdd_orphans.c b/lustre/mdd/mdd_orphans.c index 9f1a10f..f79f526 100644 --- a/lustre/mdd/mdd_orphans.c +++ b/lustre/mdd/mdd_orphans.c @@ -308,7 +308,7 @@ static int mdd_orphan_destroy(const struct lu_env *env, struct mdd_object *obj, mdd_write_lock(env, obj, DT_TGT_CHILD); rc = mdd_orphan_declare_delete(env, obj, th); - if (rc == -ENOENT) + if (rc == -ENOENT || lu_object_is_dying(obj->mod_obj.mo_lu.lo_header)) orphan_exists = false; else if (rc) GOTO(unlock, rc);