bdev: fix error path for allocating qos paramters

Every exit path in spdk_bdev_set_qos_rate_limits() should
go through _spdk_bdev_set_qos_limit_done() as soon as
ctx is allocated and qos_mod_in_progress set to true.

This patch fixes one path were it did not occur.
With this change qos_mod_in_progress is set to false,
when failure in allocating qos parameters occurs.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465659 (master)

(cherry picked from commit cfc0fbf11e)
Change-Id: I04a45dfdcde9160fd2701b44f5fde26fb0245177
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467138
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-08-19 07:59:50 -04:00 committed by Ben Walker
parent a343a2c20b
commit 9f7075ea8d

View File

@ -4779,8 +4779,7 @@ spdk_bdev_set_qos_rate_limits(struct spdk_bdev *bdev, uint64_t *limits,
if (!bdev->internal.qos) {
pthread_mutex_unlock(&bdev->internal.mutex);
SPDK_ERRLOG("Unable to allocate memory for QoS tracking\n");
free(ctx);
cb_fn(cb_arg, -ENOMEM);
_spdk_bdev_set_qos_limit_done(ctx, -ENOMEM);
return;
}
}