[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/14] 9pfs: fix error path in pdu_submit()
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PULL 07/14] 9pfs: fix error path in pdu_submit() |
Date: |
Mon, 8 Jan 2018 15:28:24 +0100 |
If we receive an unsupported request id, we first decide to
return -ENOTSUPP to the client, but since the request id
causes is_read_only_op() to return false, we change the
error to be -EROFS if the fsdev is read-only. This doesn't
make sense since we don't know what the client asked for.
This patch ensures that -EROFS can only be returned if the
request id is supported.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
hw/9pfs/9p.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 76f90f2b7863..558efb41defd 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3473,14 +3473,12 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr)
if (pdu->id >= ARRAY_SIZE(pdu_co_handlers) ||
(pdu_co_handlers[pdu->id] == NULL)) {
handler = v9fs_op_not_supp;
+ } else if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) {
+ handler = v9fs_fs_ro;
} else {
handler = pdu_co_handlers[pdu->id];
}
- if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) {
- handler = v9fs_fs_ro;
- }
-
qemu_co_queue_init(&pdu->complete);
co = qemu_coroutine_create(handler, pdu);
qemu_coroutine_enter(co);
--
2.13.6
- [Qemu-devel] [PULL 00/14] 9p patches for 2.12 20180108, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 10/14] tests: virtio-9p: set DRIVER_OK before using the device, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 05/14] 9pfs: handle: fix type definition, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 04/14] 9pfs: fix some type definitions, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 07/14] 9pfs: fix error path in pdu_submit(),
Greg Kurz <=
- [Qemu-devel] [PULL 08/14] 9pfs: make pdu_marshal() and pdu_unmarshal() static functions, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 02/14] 9pfs: fix XattrOperations typedef, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 13/14] 9pfs: deprecate handle backend, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 03/14] fsdev: fix some type definitions, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 12/14] fsdev: improve error handling of backend init, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 09/14] tests: virtio-9p: fix ISR dependence, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 06/14] 9pfs: fix type in *_parse_opts declarations, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 01/14] virtio-9p: move unrealize/realize after virtio_9p_transport definition, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 11/14] fsdev: improve error handling of backend opts parsing, Greg Kurz, 2018/01/08
- [Qemu-devel] [PULL 14/14] MAINTAINERS: Drop Aneesh as 9pfs maintainer, Greg Kurz, 2018/01/08