lvol: make the status correct.

If faced no memory status, we should set it to nomem,
thus, we can make this I/O resubmit it again.

Change-Id: Icb9a7eeab3278021fa95a5e33c7ff55b3cc62558
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/393122
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ziye Yang 2017-12-28 15:02:21 +08:00 committed by Daniel Verkamp
parent d34d32f684
commit 623161daca

View File

@ -515,8 +515,12 @@ lvol_op_comp(void *cb_arg, int bserrno)
struct spdk_bdev_io *bdev_io = spdk_bdev_io_from_ctx(task); struct spdk_bdev_io *bdev_io = spdk_bdev_io_from_ctx(task);
if (bserrno != 0) { if (bserrno != 0) {
if (bserrno == -ENOMEM) {
task->status = SPDK_BDEV_IO_STATUS_NOMEM;
} else {
task->status = SPDK_BDEV_IO_STATUS_FAILED; task->status = SPDK_BDEV_IO_STATUS_FAILED;
} }
}
SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL, "Vbdev processing callback on device %s with type %d\n", SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL, "Vbdev processing callback on device %s with type %d\n",
bdev_io->bdev->name, bdev_io->type); bdev_io->bdev->name, bdev_io->type);