[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5c1b4104-ca52-4e72-f1e2-f63f6904a713@kernel.dk>
Date: Tue, 26 May 2020 15:25:02 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Jiri Kosina <jikos@...nel.org>, Denis Efremov <efremov@...ux.com>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Libor Pechacek <lpechacek@...e.cz>
Subject: Re: [PATCH] block/floppy: fix contended case in floppy_queue_rq()
On 5/26/20 3:49 AM, Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@...e.cz>
>
> Since the switch of floppy driver to blk-mq, the contended (fdc_busy) case
> in floppy_queue_rq() is not handled correctly.
>
> In case we reach floppy_queue_rq() with fdc_busy set (i.e. with the floppy
> locked due to another request still being in-flight), we put the request
> on the list of requests and return BLK_STS_OK to the block core, without
> actually scheduling delayed work / doing further processing of the
> request. This means that processing of this request is postponed until
> another request comes and passess uncontended.
>
> Which in some cases might actually never happen and we keep waiting
> indefinitely. The simple testcase is
>
> for i in `seq 1 2000`; do echo -en $i '\r'; blkid --info /dev/fd0 2> /dev/null; done
>
> run in quemu. That reliably causes blkid eventually indefinitely hanging
> in __floppy_read_block_0() waiting for completion, as the BIO callback
> never happens, and no further IO is ever submitted on the (non-existent)
> floppy device. This was observed reliably on qemu-emulated device.
>
> Fix that by not queuing the request in the contended case, and return
> BLK_STS_RESOURCE instead, so that blk core handles the request
> rescheduling and let it pass properly non-contended later.
Applied, thanks.
--
Jens Axboe
Powered by blists - more mailing lists