lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADUfDZr_HCXHnDUDf5bcOGkBqcfttzq+1qqmhFSMvyCqcF4TBQ@mail.gmail.com>
Date: Tue, 22 Apr 2025 17:40:39 -0700
From: Caleb Sander Mateos <csander@...estorage.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Ming Lei <ming.lei@...hat.com>, Uday Shankar <ushankar@...estorage.com>
Subject: Re: [PATCH] ublk: remove unnecessary ubq checks

Hi Jens,
Would you mind queueing up this small patch for 6.16? Uday and Ming
have reviewed it.

Thanks,
Caleb

On Wed, Apr 16, 2025 at 5:02 PM Ming Lei <ming.lei@...hat.com> wrote:
>
> On Wed, Apr 16, 2025 at 11:01:53AM -0600, Caleb Sander Mateos wrote:
> > ublk_init_queues() ensures that all nr_hw_queues queues are initialized,
> > with each ublk_queue's q_id set to its index. And ublk_init_queues() is
> > called before ublk_add_chdev(), which creates the cdev. Is is therefore
> > impossible for the !ubq || ub_cmd->q_id != ubq->q_id condition to hit in
> > __ublk_ch_uring_cmd(). Remove it to avoids some branches in the I/O path.
> >
> > Signed-off-by: Caleb Sander Mateos <csander@...estorage.com>
> > ---
> >  drivers/block/ublk_drv.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> > index cdb1543fa4a9..bc86231f5e27 100644
> > --- a/drivers/block/ublk_drv.c
> > +++ b/drivers/block/ublk_drv.c
> > @@ -1947,13 +1947,10 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
> >
> >       if (ub_cmd->q_id >= ub->dev_info.nr_hw_queues)
> >               goto out;
> >
> >       ubq = ublk_get_queue(ub, ub_cmd->q_id);
> > -     if (!ubq || ub_cmd->q_id != ubq->q_id)
> > -             goto out;
> > -
>
> Looks correct, ubq->q_id is always same with the index passed to
> ublk_get_queue().
>
> Reviewed-by: Ming Lei <ming.lei@...hat.com>
>
>
> Thanks,
> Ming
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ