lib/bdev: Assert if there is no outstanding IO after completion with ENOMEM

Retry mechanism will stuck if there is no outstanding
IO after completion with ENOMEM. This should never
happen.

Change-Id: I58ebf8cc8a498231beef43ac20f58eeaad89afda
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446610
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Wojciech Malikowski 2019-02-28 11:40:14 -05:00 committed by Darek Stojaczyk
parent 39c4f95b35
commit f1da65ef28

View File

@ -3380,6 +3380,7 @@ spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status sta
shared_resource->io_outstanding--; shared_resource->io_outstanding--;
if (spdk_unlikely(status == SPDK_BDEV_IO_STATUS_NOMEM)) { if (spdk_unlikely(status == SPDK_BDEV_IO_STATUS_NOMEM)) {
assert(shared_resource->io_outstanding > 0);
TAILQ_INSERT_HEAD(&shared_resource->nomem_io, bdev_io, internal.link); TAILQ_INSERT_HEAD(&shared_resource->nomem_io, bdev_io, internal.link);
/* /*
* Wait for some of the outstanding I/O to complete before we * Wait for some of the outstanding I/O to complete before we