[RFC PATCH 14/15] virtiofs: Handle virtio_device_ready() failure
From: Xie Yongji
Date: Mon May 17 2021 - 05:37:17 EST
Now virtio_device_ready() will return error if we get
invalid status. Let's handle this case on probe.
Signed-off-by: Xie Yongji <xieyongji@xxxxxxxxxxxxx>
---
fs/fuse/virtio_fs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index e61c94eaa20f..ade0dc42ebfd 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -883,7 +883,9 @@ static int virtio_fs_probe(struct virtio_device *vdev)
/* Bring the device online in case the filesystem is mounted and
* requests need to be sent before we return.
*/
- virtio_device_ready(vdev);
+ ret = virtio_device_ready(vdev);
+ if (ret < 0)
+ goto out_vqs;
ret = virtio_fs_add_instance(fs);
if (ret < 0)
--
2.11.0