Re: [PATCH] block: avoid extra bio reference for async O_DIRECT
From: Jens Axboe <axboe@kernel.dk>
Date: 2018-11-30 15:16:07
From: Jens Axboe <axboe@kernel.dk>
Date: 2018-11-30 15:16:07
On 11/30/18 1:38 AM, Christoph Hellwig wrote:
I like the idea, but I don't think it is correct as-is. We can't just move the blkdev_bio_dirty_release for the last bio into the caller, as the completion order that decrements the refcount might have different ordering.
Ugh yeah, not sure why I forgot about the multi case for that one.
Something like the simpler patch below might archive your goal, though:
That does look cleaner. Let me run it through some testing just to ensure we don't leak or use-after-free. -- Jens Axboe