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 <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466935 (master)

(cherry picked from commit bd78196c09)
Change-Id: Ia741730cf15d44d76ce8afa7955e6a5bf42ca42b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468305
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Konrad Sztyber 2019-08-30 14:08:32 +02:00 committed by Ben Walker
parent 351fd43955
commit 84584d081f

View File

@ -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;