summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-04-01 16:43:48 +0200
committerJens Axboe <axboe@kernel.dk>2021-04-12 03:30:34 +0200
commit215c39026023dbfb4026b670c318371252be909f (patch)
tree5629e071a13a718768d712deb1c1798e64ad6d85 /fs/io_uring.c
parentio_uring: reuse io_rsrc_node_destroy() (diff)
downloadlinux-215c39026023dbfb4026b670c318371252be909f.tar.xz
linux-215c39026023dbfb4026b670c318371252be909f.zip
io_uring: remove useless is_dying check on quiesce
rsrc_data refs should always be valid for potential submitters, io_rsrc_ref_quiesce() restores it before unlocking, so percpu_ref_is_dying() check in io_sqe_files_unregister() does nothing and misleading. Concurrent quiesce is prevented with struct io_rsrc_data::quiesce. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/bf97055e1748ee3a382e66daf384a469eb90b931.1617287883.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--fs/io_uring.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 59e666151754..373fe2b9e1f2 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7135,6 +7135,7 @@ static int io_rsrc_ref_quiesce(struct io_rsrc_data *data, struct io_ring_ctx *ct
{
int ret;
+ /* As we may drop ->uring_lock, other task may have started quiesce */
if (data->quiesce)
return -ENXIO;
@@ -7197,12 +7198,7 @@ static int io_sqe_files_unregister(struct io_ring_ctx *ctx)
unsigned nr_tables, i;
int ret;
- /*
- * percpu_ref_is_dying() is to stop parallel files unregister
- * Since we possibly drop uring lock later in this function to
- * run task work.
- */
- if (!data || percpu_ref_is_dying(&data->refs))
+ if (!data)
return -ENXIO;
ret = io_rsrc_ref_quiesce(data, ctx);
if (ret)