From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
Keith Busch <keith.busch@wdc.com>,
James Smart <james.smart@broadcom.com>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>,
Sagi Grimberg <sagi@grimberg.me>
Subject: [PATCH 3/3] nvme/fcloop: flush workqueue before calling nvme_fc_unregister_remoteport()
Date: Fri, 6 Mar 2020 14:04:40 +0100 [thread overview]
Message-ID: <20200306130440.16864-4-hare@suse.de> (raw)
In-Reply-To: <20200306130440.16864-1-hare@suse.de>
nvme_fc_unregister_remoteport() will be sending LS requests, which then
would end up on a workqueue for processing. This will deadlock with
fcloop_remoteport_delete() which would try to flush the very same queue.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/nvme/target/fcloop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
index 4f9435d9fa61..0209da9bcb67 100644
--- a/drivers/nvme/target/fcloop.c
+++ b/drivers/nvme/target/fcloop.c
@@ -943,7 +943,6 @@ fcloop_remoteport_delete(struct nvme_fc_remote_port *remoteport)
{
struct fcloop_rport *rport = remoteport->private;
- flush_work(&rport->ls_work);
fcloop_nport_put(rport->nport);
}
@@ -1278,6 +1277,7 @@ __remoteport_unreg(struct fcloop_nport *nport, struct fcloop_rport *rport)
if (!rport)
return -EALREADY;
+ flush_work(&rport->ls_work);
return nvme_fc_unregister_remoteport(rport->remoteport);
}
--
2.16.4
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-03-06 13:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 13:04 [PATCH 0/3] nvmet/fcloop fixes Hannes Reinecke
2020-03-06 13:04 ` [PATCH 1/3] nvmet/fc: Sanitize tgtport reference counting for LS requests Hannes Reinecke
2020-03-06 22:11 ` Sagi Grimberg
2020-03-07 1:00 ` James Smart
2020-03-10 16:52 ` Christoph Hellwig
2020-03-06 13:04 ` [PATCH 2/3] nvme/fcloop: short-circuit LS requests if no association is present Hannes Reinecke
2020-03-06 22:12 ` Sagi Grimberg
2020-03-07 1:11 ` James Smart
2020-03-07 8:39 ` Hannes Reinecke
2020-03-06 13:04 ` Hannes Reinecke [this message]
2020-03-06 22:12 ` [PATCH 3/3] nvme/fcloop: flush workqueue before calling nvme_fc_unregister_remoteport() Sagi Grimberg
2020-03-07 1:12 ` James Smart
2020-03-07 8:41 ` Hannes Reinecke
2020-03-31 14:24 ` [PATCH 0/3] nvmet/fcloop fixes Christoph Hellwig
2020-04-16 10:37 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200306130440.16864-4-hare@suse.de \
--to=hare@suse.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=keith.busch@wdc.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox