From a50100900d04a6c8cc61e45db97b87a6f5b7d774 Mon Sep 17 00:00:00 2001 From: paul luse Date: Fri, 12 Apr 2019 13:39:43 -0400 Subject: [PATCH] bdev/compress: return error to reducelib if comp/decomp fails Change-Id: Ibdea83543069e80d73358e95fa43f7b27c351d1a Signed-off-by: paul luse Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451064 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/bdev/compress/vbdev_compress.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/bdev/compress/vbdev_compress.c b/lib/bdev/compress/vbdev_compress.c index 8b2541416..01e9d27af 100644 --- a/lib/bdev/compress/vbdev_compress.c +++ b/lib/bdev/compress/vbdev_compress.c @@ -521,7 +521,13 @@ _comp_reduce_compress(struct spdk_reduce_backing_dev *dev, struct iovec *dst_iovs, int dst_iovcnt, struct spdk_reduce_vol_cb_args *cb_arg) { - _compress_operation(dev, src_iovs, src_iovcnt, dst_iovs, dst_iovcnt, true, cb_arg); + int rc; + + rc = _compress_operation(dev, src_iovs, src_iovcnt, dst_iovs, dst_iovcnt, true, cb_arg); + if (rc) { + SPDK_ERRLOG("with compress operation code %d (%s)\n", rc, spdk_strerror(-rc)); + cb_arg->cb_fn(cb_arg->cb_arg, rc); + } } /* Entry point for reduce lib to issue a decompress operation. */ @@ -531,7 +537,13 @@ _comp_reduce_decompress(struct spdk_reduce_backing_dev *dev, struct iovec *dst_iovs, int dst_iovcnt, struct spdk_reduce_vol_cb_args *cb_arg) { - _compress_operation(dev, src_iovs, src_iovcnt, dst_iovs, dst_iovcnt, false, cb_arg); + int rc; + + rc = _compress_operation(dev, src_iovs, src_iovcnt, dst_iovs, dst_iovcnt, false, cb_arg); + if (rc) { + SPDK_ERRLOG("with decompress operation code %d (%s)\n", rc, spdk_strerror(-rc)); + cb_arg->cb_fn(cb_arg->cb_arg, rc); + } } /* Callback for getting a buf from the bdev pool in the event that the caller passed