io_uring/uring_cmd: ensure that device supports IOPOLL
authorJens Axboe <axboe@kernel.dk>
Wed, 8 Mar 2023 16:26:13 +0000 (09:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:14 +0000 (08:50 +0100)
commitda8fab32a712511100e8f872a88f36fa74756cfa
tree286cee7dbcc0447efa91a4156af1b2b84e073a2c
parentfceed91ea1ba9d130e760d65f4a8e23db375da96
io_uring/uring_cmd: ensure that device supports IOPOLL

commit 03b3d6be73e81ddb7c2930d942cdd17f4cfd5ba5 upstream.

It's possible for a file type to support uring commands, but not
pollable ones. Hence before issuing one of those, we should check
that it is supported and error out upfront if it isn't.

Cc: stable@vger.kernel.org
Fixes: 5756a3a7e713 ("io_uring: add iopoll infrastructure for io_uring_cmd")
Link: https://github.com/axboe/liburing/issues/816
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/uring_cmd.c