Re: [PATCH v2 03/28] block: Introduce blk_zone_update_request_bio()

Damien Le Moal
2024-03-25T23:23:21Z

On 3/26/24 04:52, Bart Van Assche wrote:
> On 3/24/24 21:44, Damien Le Moal wrote:
>> diff --git a/block/blk-mq.c b/block/blk-mq.c
>> index 8aeb8e96f1a7..9e6e2a9a147c 100644
>> --- a/block/blk-mq.c
>> +++ b/block/blk-mq.c
>> @@ -820,11 +820,11 @@ static void blk_complete_request(struct request *req)
>> /* Completion has already been traced */
>> bio_clear_flag(bio, BIO_TRACE_COMPLETION);
>>
>> - if (req_op(req) == REQ_OP_ZONE_APPEND)
>> - bio->bi_iter.bi_sector = req->__sector;
>> -
>> - if (!is_flush)
>> + if (!is_flush) {
>> + blk_zone_update_request_bio(req, bio);
>> bio_endio(bio);
>> + }
>
> The above change includes a behavior change. It seems wrong to me not
> to call blk_zone_update_request_bio() for REQ_OP_ZONE_APPEND requests if
> RQF_FLUSH_SEQ has been set.

REQ_OP_ZONE_APPEND + RQF_FLUSH_SEQ is not something supported, and this patch
series is not changing that. The reason is that the flush machinery is not
zone-append aware and will break if such request is issued for a device that
does not support fua. We probably should check for this, but that is not
something for this series to do and should be a separate fix.

--
Damien Le Moal
Western Digital Research