aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lei <[email protected]>2023-08-09 10:04:40 +0800
committerJens Axboe <[email protected]>2023-08-11 08:12:32 -0600
commita7a7dabb5dd72d2875bc3ce56f94ea5ceb259d5b (patch)
tree1b4104bd16a57891c511cb8758ee560f8249b7c2
parentf099a108cabf72a1184b1e14e4a09f4ca3375750 (diff)
nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll
Now nvme_ns_chr_uring_cmd_iopoll() has switched to request based io polling, and the associated NS is guaranteed to be live in case of io polling, so request is guaranteed to be valid because blk-mq uses pre-allocated request pool. Remove the rcu read lock in nvme_ns_chr_uring_cmd_iopoll(), which isn't needed any more after switching to request based io polling. Fix "BUG: sleeping function called from invalid context" because set_page_dirty_lock() from blk_rq_unmap_user() may sleep. Fixes: 585079b6e425 ("nvme: wire up async polling for io passthrough commands") Reported-by: Guangwu Zhang <[email protected]> Cc: Kanchan Joshi <[email protected]> Cc: Anuj Gupta <[email protected]> Signed-off-by: Ming Lei <[email protected]> Tested-by: Guangwu Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/nvme/host/ioctl.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index 5c3250f36ce7..d39f3219358b 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -786,11 +786,9 @@ int nvme_ns_chr_uring_cmd_iopoll(struct io_uring_cmd *ioucmd,
if (!(ioucmd->flags & IORING_URING_CMD_POLLED))
return 0;
- rcu_read_lock();
req = READ_ONCE(ioucmd->cookie);
if (req && blk_rq_is_poll(req))
ret = blk_rq_poll(req, iob, poll_flags);
- rcu_read_unlock();
return ret;
}
#ifdef CONFIG_NVME_MULTIPATH