public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH RESEND] block: improve ioprio value validity checks
Date: Mon, 12 Jun 2023 11:20:07 +0900	[thread overview]
Message-ID: <36d32720-569b-4172-0c8a-aef846541185@kernel.org> (raw)
In-Reply-To: <CACRpkdbmxoUwcwHdw4bcgaDy633ZKLOZ3z-d1qjzBF42omC1CA@mail.gmail.com>

On 6/9/23 16:46, Linus Walleij wrote:
> On Thu, Jun 8, 2023 at 11:55 AM Damien Le Moal <dlemoal@kernel.org> wrote:
> 
>> The introduction of the macro IOPRIO_PRIO_LEVEL() in commit
>> eca2040972b4 ("scsi: block: ioprio: Clean up interface definition")
>> results in an iopriority level to always be masked using the macro
>> IOPRIO_LEVEL_MASK, and thus to the kernel always seeing an acceptable
>> value for an I/O priority level when checked in ioprio_check_cap().
>> Before this patch, this function would return an error for some (but not
>> all) invalid values for a level valid range of [0..7].
>>
>> Restore and improve the detection of invalid priority levels by
>> introducing the inline function ioprio_value() to check an ioprio class,
>> level and hint value before combining these fields into a single value
>> to be used with ioprio_set() or AIOs. If an invalid value for the class,
>> level or hint of an ioprio is detected, ioprio_value() returns an ioprio
>> using the class IOPRIO_CLASS_INVALID, indicating an invalid value and
>> causing ioprio_check_cap() to return -EINVAL.
>>
>> Fixes: 6c913257226a ("scsi: block: Introduce ioprio hints")
>> Fixes: eca2040972b4 ("scsi: block: ioprio: Clean up interface definition")
>> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> 
> This makes it easier to get things right.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks Linus !

Martin,

can you queue this please ?

> 
> Yours,
> Linus Walleij

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2023-06-12  2:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  9:55 [PATCH RESEND] block: improve ioprio value validity checks Damien Le Moal
2023-06-08 10:54 ` Niklas Cassel
2023-06-09  7:46 ` Linus Walleij
2023-06-12  2:20   ` Damien Le Moal [this message]
2023-06-15  1:27 ` Martin K. Petersen
2023-06-22  1:26 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36d32720-569b-4172-0c8a-aef846541185@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=niklas.cassel@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox