* Re: [RFC PATCH 13/15] virtio-mem: Handle virtio_device_ready() failure
[not found] ` <20210517093428.670-14-xieyongji@bytedance.com>
@ 2021-05-17 9:48 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2021-05-17 9:48 UTC (permalink / raw)
To: Xie Yongji, mst, jasowang, stefanha
Cc: ohad, jean-philippe, amit, airlied, miklos, linux-kernel,
bjorn.andersson, virtualization, vgoyal
On 17.05.21 11:34, Xie Yongji wrote:
> 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@bytedance.com>
> ---
> drivers/virtio/virtio_mem.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
> index 32a8e359a5c3..1148c392ff94 100644
> --- a/drivers/virtio/virtio_mem.c
> +++ b/drivers/virtio/virtio_mem.c
> @@ -2602,13 +2602,17 @@ static int virtio_mem_probe(struct virtio_device *vdev)
> if (rc)
> goto out_unreg_mem;
>
> - virtio_device_ready(vdev);
> + rc = virtio_device_ready(vdev);
> + if (rc)
> + goto out_unreg_device;
>
> /* trigger a config update to start processing the requested_size */
> atomic_set(&vm->config_changed, 1);
> queue_work(system_freezable_wq, &vm->wq);
>
> return 0;
> +out_unreg_device:
> + unregister_virtio_mem_device(vm);
> out_unreg_mem:
> unregister_memory_notifier(&vm->memory_notifier);
> out_del_resource:
>
I assume this will really be a corner case to hit, right?
Failing after essentially being done initializing looks sub-optimal, anyhow:
Acked-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC PATCH 15/15] 9p/trans_virtio: Handle virtio_device_ready() failure
[not found] ` <20210517093428.670-16-xieyongji@bytedance.com>
@ 2021-05-17 9:53 ` asmadeus
0 siblings, 0 replies; 2+ messages in thread
From: asmadeus @ 2021-05-17 9:53 UTC (permalink / raw)
To: Xie Yongji
Cc: ohad, jean-philippe, amit, airlied, mst, linux-kernel,
bjorn.andersson, miklos, stefanha, virtualization, vgoyal
Xie Yongji wrote on Mon, May 17, 2021 at 05:34:28PM +0800:
> Now virtio_device_ready() will return error if we get
> invalid status. Let's handle this case on probe.
The change itself looks good to me
It's going to be a pain to apply though because it depends on
https://lkml.kernel.org/r/20210517083557.172-1-xieyongji@bytedance.com
you just sent, so this won't apply to virtio maintainers on one hand,
and I can't take just this patch because it depends on the first patch
in the patchset (well if it weren't RFC)...
I guess sending the other patch to Linus fast-ish so it can go in virtio
tree would be the best way forward? other maintainers please advise, I'm
bad at this.
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Dominique Martinet <asmadeus@codewreck.org>
--
Dominique
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-17 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210517093428.670-1-xieyongji@bytedance.com>
[not found] ` <20210517093428.670-14-xieyongji@bytedance.com>
2021-05-17 9:48 ` [RFC PATCH 13/15] virtio-mem: Handle virtio_device_ready() failure David Hildenbrand
[not found] ` <20210517093428.670-16-xieyongji@bytedance.com>
2021-05-17 9:53 ` [RFC PATCH 15/15] 9p/trans_virtio: " asmadeus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).