From 364a75cbb9648f6d64d948e0dd53c59899021913 Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Mon, 8 Jun 2020 23:24:12 +0300 Subject: [PATCH] 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 --- lustre/mdd/mdd_orphans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 1.8.3.1