On 1/9/20 6:17 AM, Dmitrii Dolgov wrote: > diff --git a/fs/io_uring.c b/fs/io_uring.c > index c770c2c0eb52..c5e69dfc0221 100644 > --- a/fs/io_uring.c > +++ b/fs/io_uring.c > @@ -1232,7 +1232,8 @@ static void io_free_req_many(struct io_ring_ctx *ctx, struct req_batch *rb) > do_free: > kmem_cache_free_bulk(req_cachep, rb->to_free, rb->reqs); > percpu_ref_put_many(&ctx->refs, rb->to_free); > - percpu_ref_put_many(&ctx->file_data->refs, rb->to_free); > + if (ctx->file_data) > + percpu_ref_put_many(&ctx->file_data->refs, rb->to_free); > rb->to_free = rb->need_iter = 0; > } Can you check with just the two ref_put lines swapped? Ala: percpu_ref_put_many(&ctx->file_data->refs, rb->to_free); percpu_ref_put_many(&ctx->refs, rb->to_free); -- Jens Axboe