Re: [PATCH 1/3] ublk_drv: check ubq_daemon_is_dying() in __ublk_rq_task_work()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 9, 2022 at 5:17 PM ZiyangZhang
<ZiyangZhang@xxxxxxxxxxxxxxxxx> wrote:
>
> Replace direct check on PF_EXITING in __ublk_rq_task_work() by the
> existing wrapper. Also inline ubq_daemon_is_dying().
>
> Signed-off-by: ZiyangZhang <ZiyangZhang@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/block/ublk_drv.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 2b7d1db5c4a7..3797bd64c3c3 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -555,7 +555,7 @@ static inline struct ublk_uring_cmd_pdu *ublk_get_uring_cmd_pdu(
>         return (struct ublk_uring_cmd_pdu *)&ioucmd->pdu;
>  }
>
> -static bool ubq_daemon_is_dying(struct ublk_queue *ubq)
> +static inline bool ubq_daemon_is_dying(struct ublk_queue *ubq)
>  {
>         return ubq->ubq_daemon->flags & PF_EXITING;
>  }
> @@ -644,8 +644,7 @@ static inline void __ublk_rq_task_work(struct request *req)
>         struct ublk_device *ub = ubq->dev;
>         int tag = req->tag;
>         struct ublk_io *io = &ubq->ios[tag];
> -       bool task_exiting = current != ubq->ubq_daemon ||
> -               (current->flags & PF_EXITING);
> +       bool task_exiting = current != ubq->ubq_daemon || ubq_daemon_is_dying(ubq);

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>

Thanks,




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux