[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <823cd0d7-1688-7d11-1e9b-2de29b6065a6@grimberg.me>
Date: Mon, 24 Aug 2020 13:00:11 -0700
From: Sagi Grimberg <sagi@...mberg.me>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
james.smart@...adcom.com, hch@....de, chaitanya.kulkarni@....com
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] nvmet-fc: Fix a missed _irqsave version of spin_lock in
'nvmet_fc_fod_op_done()'
> The way 'spin_lock()' and 'spin_lock_irqsave()' are used is not consistent
> in this function.
>
> Use 'spin_lock_irqsave()' also here, as there is no guarantee that
> interruptions are disabled at that point, according to surrounding code.
>
> Fixes: a97ec51b37ef ("nvmet_fc: Rework target side abort handling")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Not tested, only based on what looks logical to me according to
> surrounding code
> ---
> drivers/nvme/target/fc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
> index 55bafd56166a..e6861cc10e7d 100644
> --- a/drivers/nvme/target/fc.c
> +++ b/drivers/nvme/target/fc.c
> @@ -2342,9 +2342,9 @@ nvmet_fc_fod_op_done(struct nvmet_fc_fcp_iod *fod)
> return;
> if (fcpreq->fcp_error ||
> fcpreq->transferred_length != fcpreq->transfer_length) {
> - spin_lock(&fod->flock);
> + spin_lock_irqsave(&fod->flock, flags);
> fod->abort = true;
> - spin_unlock(&fod->flock);
> + spin_unlock_irqrestore(&fod->flock, flags);
>
> nvmet_req_complete(&fod->req, NVME_SC_INTERNAL);
> return;
>
James, can I get a reviewed-by from you on this?
Powered by blists - more mailing lists