linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use rsps_lock in nvmet_rdma_free_rsp
@ 2016-11-22  5:36 Tomita.Haruo
  2016-11-22  7:41 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Tomita.Haruo @ 2016-11-22  5:36 UTC (permalink / raw)


Hi Christoph and Sagi,

Without using rsps_lock in nvmet_rdma_free_rsp,  free_list is being operated.
The following patch, this issue fixed. Is this patch right?

rdma.c |    3 +++
 1 file changed, 3 insertions(+)

--- linux-4.9-rc6/drivers/nvme/target/rdma.c.org        2016-11-21 06:52:19.000000000 +0900
+++ linux-4.9-rc6/drivers/nvme/target/rdma.c    2016-11-22 14:22:27.482438775 +0900
@@ -423,11 +423,14 @@ static void nvmet_rdma_free_rsps(struct
 {
        struct nvmet_rdma_device *ndev = queue->dev;
        int i, nr_rsps = queue->recv_queue_size * 2;
+       unsigned long flags;

        for (i = 0; i < nr_rsps; i++) {
                struct nvmet_rdma_rsp *rsp = &queue->rsps[i];

+               spin_lock_irqsave(&queue->rsps_lock, flags);
                list_del(&rsp->free_list);
+               spin_unlock_irqrestore(&queue->rsps_lock, flags);
                nvmet_rdma_free_rsp(ndev, rsp);
        }
        kfree(queue->rsps);

thanks
--
Haruo

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] Use rsps_lock in nvmet_rdma_free_rsp
@ 2016-11-22  5:32 Tomita.Haruo
  0 siblings, 0 replies; 5+ messages in thread
From: Tomita.Haruo @ 2016-11-22  5:32 UTC (permalink / raw)


Hi Christoph and Sagi,

Without using rsps_lock in nvmet_rdma_free_rsp,  free_list is being operated.
The following patch, this issue fixed. Is this patch right?

rdma.c |    3 +++
 1 file changed, 3 insertions(+)

--- linux-4.9-rc6/drivers/nvme/target/rdma.c.org        2016-11-21 06:52:19.000000000 +0900
+++ linux-4.9-rc6/drivers/nvme/target/rdma.c    2016-11-22 14:04:59.387510444 +0900
@@ -423,11 +423,14 @@ static void nvmet_rdma_free_rsps(struct
 {
        struct nvmet_rdma_device *ndev = queue->dev;
        int i, nr_rsps = queue->recv_queue_size * 2;
+       unsigned long flags;

        for (i = 0; i < nr_rsps; i++) {
+               spin_lock_irqsave(&queue->rsps_lock, flags);
                struct nvmet_rdma_rsp *rsp = &queue->rsps[i];

                list_del(&rsp->free_list);
+               spin_unlock_irqrestore(&queue->rsps_lock, flags);
                nvmet_rdma_free_rsp(ndev, rsp);
        }
        kfree(queue->rsps);

thanks
--
Haruo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-25  7:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22  5:36 [PATCH] Use rsps_lock in nvmet_rdma_free_rsp Tomita.Haruo
2016-11-22  7:41 ` Christoph Hellwig
2016-11-25  5:00   ` Tomita.Haruo
2016-11-25  7:53     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2016-11-22  5:32 Tomita.Haruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).