Re: [PATCH v2] loop: avoid EAGAIN, if offset or block_size are changed

From: Bart Van Assche
Date: Mon Nov 25 2019 - 14:41:54 EST


On 11/25/19 11:22 AM, Jaegeuk Kim wrote:
On 11/25, Bart Van Assche wrote:
Thank you for the additional and very helpful clarification. Can you have a look at the (totally untested) patch below? I prefer that version because it prevents concurrent processing of requests and syncing/killing the bdev.

Yeah, I thought this was much cleaner way, but wasn't sure it could be doable
to sync|kill block device after freezing the queue. Is it okay?

Hi Jaegeuk,

That patch was based on an incorrect interpretation of the meaning of lo_device. After having taken another loop at the block driver, I don't think that calling sync after freezing the queue is OK. How about using the following call sequence:
* sync_blockdev()
* blk_mq_freeze_queue()
* kill_bdev()

Thanks,

Bart.