Whamcloud - gitweb
LU-13649 mdd: orhpan cleanup fix 66/38866/2
authorVitaly Fertman <c17818@cray.com>
Mon, 8 Jun 2020 20:24:12 +0000 (23:24 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 Jun 2020 16:50:34 +0000 (16:50 +0000)
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 <c17818@cray.com>
Change-Id: I7e2f3fca7b7d4440340fd3daaf8ec528010d9117
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Tested-by: Alexander Lezhoev <c17454@cray.com>
Reviewed-on: https://review.whamcloud.com/38866
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index 9f1a10f..f79f526 100644 (file)
@@ -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);