diff mbox series

[RFC,03/13] io_uring: mark iopoll not supported for uring-cmd

Message ID 20211220141734.12206-4-joshi.k@samsung.com (mailing list archive)
State New, archived
Headers show
Series uring-passthru for nvme | expand

Commit Message

Kanchan Joshi Dec. 20, 2021, 2:17 p.m. UTC
From: Anuj Gupta <anuj20.g@samsung.com>

Currently uring-passthrough doesn't support iopoll. Bail out to avoid
the panic.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 fs/io_uring.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Luis Chamberlain Feb. 17, 2022, 2:16 a.m. UTC | #1
On Mon, Dec 20, 2021 at 07:47:24PM +0530, Kanchan Joshi wrote:
> From: Anuj Gupta <anuj20.g@samsung.com>
> 
> Currently uring-passthrough doesn't support iopoll. Bail out to avoid
> the panic.
> 
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>

Jens, can you fold this in to your series?

  Luis
Jens Axboe Feb. 17, 2022, 2:52 a.m. UTC | #2
On 2/16/22 7:16 PM, Luis Chamberlain wrote:
> On Mon, Dec 20, 2021 at 07:47:24PM +0530, Kanchan Joshi wrote:
>> From: Anuj Gupta <anuj20.g@samsung.com>
>>
>> Currently uring-passthrough doesn't support iopoll. Bail out to avoid
>> the panic.
>>
>> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
> 
> Jens, can you fold this in to your series?

Yes, we really need to spin a new series with the bits combined. I've
got some ideas for that...
diff mbox series

Patch

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 246f1085404d..1061b4cde4be 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4131,6 +4131,11 @@  static int io_uring_cmd_prep(struct io_kiocb *req,
 	if (!req->file->f_op->async_cmd)
 		return -EOPNOTSUPP;
 
+	if (req->ctx->flags & IORING_SETUP_IOPOLL) {
+		printk_once(KERN_WARNING "io_uring: iopoll not supported!\n");
+		return -EOPNOTSUPP;
+	}
+
 	cmd->op = READ_ONCE(csqe->op);
 	cmd->len = READ_ONCE(csqe->len);