From 84584d081ff9c1473e3ee15e685bb2196bfb6048 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Fri, 30 Aug 2019 14:08:32 +0200 Subject: [PATCH] lib/ftl: delay processing ANM events initialization is completed Start processing ANM events only after the device is fully initialized. Otherwise some of the structures are partially filled and can be interpreted incorrectly. Signed-off-by: Konrad Sztyber Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466935 (master) (cherry picked from commit bd78196c0965e22f0c24fc93dfc97e822b0b0149) Change-Id: Ia741730cf15d44d76ce8afa7955e6a5bf42ca42b Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468305 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/ftl/ftl_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index a039a2054..eca7bf849 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -2114,6 +2114,12 @@ ftl_process_anm_event(struct ftl_anm_event *event) struct ftl_band *band; size_t lbkoff; + /* Drop any ANM requests until the device is initialized */ + if (!dev->initialized) { + ftl_anm_event_complete(event); + return; + } + if (!ftl_check_core_thread(dev)) { spdk_thread_send_msg(ftl_get_core_thread(dev), _ftl_process_anm_event, event); return;