File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -8652,13 +8652,10 @@ static void io_req_caches_free(struct io_ring_ctx *ctx)
8652
8652
mutex_unlock (& ctx -> uring_lock );
8653
8653
}
8654
8654
8655
- static bool io_wait_rsrc_data (struct io_rsrc_data * data )
8655
+ static void io_wait_rsrc_data (struct io_rsrc_data * data )
8656
8656
{
8657
- if (!data )
8658
- return false;
8659
- if (!atomic_dec_and_test (& data -> refs ))
8657
+ if (data && !atomic_dec_and_test (& data -> refs ))
8660
8658
wait_for_completion (& data -> done );
8661
- return true;
8662
8659
}
8663
8660
8664
8661
static void io_ring_ctx_free (struct io_ring_ctx * ctx )
@@ -8670,10 +8667,14 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx)
8670
8667
ctx -> mm_account = NULL ;
8671
8668
}
8672
8669
8670
+ /* __io_rsrc_put_work() may need uring_lock to progress, wait w/o it */
8671
+ io_wait_rsrc_data (ctx -> buf_data );
8672
+ io_wait_rsrc_data (ctx -> file_data );
8673
+
8673
8674
mutex_lock (& ctx -> uring_lock );
8674
- if (io_wait_rsrc_data ( ctx -> buf_data ) )
8675
+ if (ctx -> buf_data )
8675
8676
__io_sqe_buffers_unregister (ctx );
8676
- if (io_wait_rsrc_data ( ctx -> file_data ) )
8677
+ if (ctx -> file_data )
8677
8678
__io_sqe_files_unregister (ctx );
8678
8679
if (ctx -> rings )
8679
8680
__io_cqring_overflow_flush (ctx , true);
You can’t perform that action at this time.
0 commit comments