Skip to content

Commit

Permalink
nvmet-fc: Fix a missed _irqsave version of spin_lock in 'nvmet_fc_fod…
Browse files Browse the repository at this point in the history
…_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: a97ec51 ("nvmet_fc: Rework target side abort handling")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
  • Loading branch information
Christophe JAILLET authored and Sagi Grimberg committed Aug 28, 2020
1 parent 7cd49f7 commit 70e3798
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvme/target/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 70e3798

Please sign in to comment.