Skip to content

Commit f644d21

Browse files
dwsusekeithbusch
authored andcommitted
nvmet-fcloop: Remove remote port from list when unlinking
The remote port is removed too late from fcloop_nports list. Remove it when port is unregistered. This prevents a busy loop in fcloop_exit, because it is possible the remote port is found in the list and thus we will never progress. The kernel log will be spammed with nvme_fcloop: fcloop_exit: Failed deleting remote port nvme_fcloop: fcloop_exit: Failed deleting target port Signed-off-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 0e716ce commit f644d21

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/nvme/target/fcloop.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,11 +995,6 @@ fcloop_nport_free(struct kref *ref)
995995
{
996996
struct fcloop_nport *nport =
997997
container_of(ref, struct fcloop_nport, ref);
998-
unsigned long flags;
999-
1000-
spin_lock_irqsave(&fcloop_lock, flags);
1001-
list_del(&nport->nport_list);
1002-
spin_unlock_irqrestore(&fcloop_lock, flags);
1003998

1004999
kfree(nport);
10051000
}
@@ -1357,6 +1352,8 @@ __unlink_remote_port(struct fcloop_nport *nport)
13571352
nport->tport->remoteport = NULL;
13581353
nport->rport = NULL;
13591354

1355+
list_del(&nport->nport_list);
1356+
13601357
return rport;
13611358
}
13621359

0 commit comments

Comments
 (0)