nvmet-fc: on port remove call put outside lock
Avoid calling the put routine, as it may traverse to free routines while holding the target lock. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e4d753d7e5
commit
3688feb582
1 changed files with 5 additions and 1 deletions
|
@ -2530,13 +2530,17 @@ nvmet_fc_remove_port(struct nvmet_port *port)
|
|||
{
|
||||
struct nvmet_fc_tgtport *tgtport = port->priv;
|
||||
unsigned long flags;
|
||||
bool matched = false;
|
||||
|
||||
spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
|
||||
if (tgtport->port == port) {
|
||||
nvmet_fc_tgtport_put(tgtport);
|
||||
matched = true;
|
||||
tgtport->port = NULL;
|
||||
}
|
||||
spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
|
||||
|
||||
if (matched)
|
||||
nvmet_fc_tgtport_put(tgtport);
|
||||
}
|
||||
|
||||
static struct nvmet_fabrics_ops nvmet_fc_tgt_fcp_ops = {
|
||||
|
|
Loading…
Reference in a new issue