virtio-blk: improve virtqueue error to BLK_STS
authorHalil Pasic <pasic@linux.ibm.com>
Thu, 13 Feb 2020 12:37:28 +0000 (13:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:33:05 +0000 (16:33 +0200)
commit3edd55247295f6ee7453e759502972caa39c66a4
treee4c944cc8980a0c1bd2e39321953bd18e4c2efdf
parent2390698b9dbdd8971397d6d19d90229bb973c669
virtio-blk: improve virtqueue error to BLK_STS

[ Upstream commit 3d973b2e9a625996ee997c7303cd793b9d197c65 ]

Let's change the mapping between virtqueue_add errors to BLK_STS
statuses, so that -ENOSPC, which indicates virtqueue full is still
mapped to BLK_STS_DEV_RESOURCE, but -ENOMEM which indicates non-device
specific resource outage is mapped to BLK_STS_RESOURCE.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Link: https://lore.kernel.org/r/20200213123728.61216-3-pasic@linux.ibm.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/virtio_blk.c