Re: blkdev_issue_discard() hangs forever if the underlying storagedevice is removed

From: Bart Van Assche
Date: Tue Aug 30 2011 - 06:39:08 EST


On Tue, Aug 30, 2011 at 4:01 AM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> On Mon, Aug 29, 2011 at 07:56:33PM +0200, Bart Van Assche wrote:
>> A key fact here is that the block device to which the discard request
>> was issued is gone, so the discard request will never finish
>> successfully. Do all relevant error paths guarantee that
>> blkdev_issue_discard() will finish in a finite time ?
>
> The underlying block device driver is supposed to handle timing out
> of lost IOs and causcwinge them to be completed with an error.
> blkdev_issue_discard() is simply waiting for that error to be
> delivered.
>
> If the driver has not detected that an outstanding request has not
> completed then that is a driver bug, not a bug in
> blkdev_issue_discard(). IOWs, you should be asking the ib_srp people
> why the in flight bio was not timed out or errored out when the
> block device abort was run....

Sorry, but the above doesn't make sense. This issue has nothing to do
with the ib_srp implementation: blkdev_issue_discard() was invoked by
mkfs after ib_srp had removed the SCSI host associated with the block
device. So none of the code in ib_srp has been invoked while
processing this blkdev_issue_discard() call.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/