Re: block: wrong return value by bio_end_sector?

From: Jens Axboe
Date: Fri Sep 30 2022 - 12:35:49 EST


On 9/30/22 9:59 AM, Paolo Valente wrote:
> Hi Jens, Damien, all other possibly interested people,
> this is to raise attention on a mistake that has emerged in a
> thread on a bfq extension for multi-actuary drives [1].
>
> The mistake is apparently in the macro bio_end_sector (defined in
> include/linux/bio.h), which seems to be translated (incorrectly) as
> sector+size, and not as sector+size-1.
>
> For your convenience, I'm pasting a detailed description of the
> problem, by Tyler (description taken from the above thread [1]).

I'm a little confused - currently it returns non-inclusive end, the
proposed change just make it inclusive. In general in the kernel the
former is used, and this one follows that.

--
Jens Axboe