Commit d5ffabca authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

bdev/ocssd: verify namespace population in notification cb



Each namespace should be checked if it is populated when handling chunk
notifications.  Otherwise we risk segfaulting if a namespace gets
depopulated before the notification callback is executed.

Change-Id: Ic55104a52087b1ea7090eeaede3e2221682cd331
Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482410


Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 56c7da0e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -918,7 +918,8 @@ bdev_ocssd_handle_chunk_notification(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr)
	uint32_t nsid;

	for (nsid = 0; nsid < nvme_bdev_ctrlr->num_ns; ++nsid) {
		if (nvme_bdev_ctrlr->namespaces[nsid] == NULL) {
		if (nvme_bdev_ctrlr->namespaces[nsid] == NULL ||
		    !nvme_bdev_ctrlr->namespaces[nsid]->populated) {
			continue;
		}