From 66ce3d8005f9a37f55c36146bb73476c6f6f1d22 Mon Sep 17 00:00:00 2001
From: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Date: Wed, 17 Feb 2021 20:57:38 +0900
Subject: [PATCH 09/15] bdev/ocssd: Fix the bug that no media event is pushed
 to the target bdev

Recent refactoring added a critical bug that no media event is pushed
to the target bdev.

Fix the bug by changing return to break.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6455 (master)

(cherry picked from commit bd8de45801cc0b45dedddef6534cd35493163b29)
Change-Id: Ia674ea2c9c21d08dd23b50a0f726da55011d4be4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6616
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
---
 module/bdev/nvme/bdev_ocssd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/bdev/nvme/bdev_ocssd.c b/module/bdev/nvme/bdev_ocssd.c
index 1cf1705..748b454 100644
--- a/module/bdev/nvme/bdev_ocssd.c
+++ b/module/bdev/nvme/bdev_ocssd.c
@@ -967,7 +967,7 @@ bdev_ocssd_push_media_events(struct nvme_bdev_ns *nvme_ns,
 	TAILQ_FOREACH(nvme_bdev, &nvme_ns->bdevs, tailq) {
 		ocssd_bdev = SPDK_CONTAINEROF(nvme_bdev, struct ocssd_bdev, nvme_bdev);
 		if (bdev_ocssd_lba_in_range(ocssd_bdev, ocssd_ns, chunk_entry->lba)) {
-			return;
+			break;
 		}
 	}
 
-- 
1.8.3.1

