Patch "RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-rtrs-srv-destroy-path-files-after-making-sure-n.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a17fe2742862207c33f068496d07d4ccfecc3efd
Author: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
Date:   Mon Nov 20 16:41:42 2023 +0100

    RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight
    
    [ Upstream commit c4d32e77fc1006f99eeb78417efc3d81a384072a ]
    
    Destroying path files may lead to the freeing of rdma_stats. This creates
    the following race.
    
    An IO is in-flight, or has just passed the session state check in
    process_read/process_write. The close_work gets triggered and the function
    rtrs_srv_close_work() starts and does destroy path which frees the
    rdma_stats. After this the function process_read/process_write resumes and
    tries to update the stats through the function rtrs_srv_update_rdma_stats
    
    This commit solves the problem by moving the destroy path function to a
    later point. This point makes sure any inflights are completed. This is
    done by qp drain, and waiting for all in-flights through ops_id.
    
    Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality")
    Signed-off-by: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
    Signed-off-by: Santosh Kumar Pradhan <santosh.pradhan@xxxxxxxxx>
    Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20231120154146.920486-6-haris.iqbal@xxxxxxxxx
    Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
index 925b71481c628..1d33efb8fb03b 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
@@ -1532,7 +1532,6 @@ static void rtrs_srv_close_work(struct work_struct *work)
 
 	srv_path = container_of(work, typeof(*srv_path), close_work);
 
-	rtrs_srv_destroy_path_files(srv_path);
 	rtrs_srv_stop_hb(srv_path);
 
 	for (i = 0; i < srv_path->s.con_num; i++) {
@@ -1552,6 +1551,8 @@ static void rtrs_srv_close_work(struct work_struct *work)
 	/* Wait for all completion */
 	wait_for_completion(&srv_path->complete_done);
 
+	rtrs_srv_destroy_path_files(srv_path);
+
 	/* Notify upper layer if we are the last path */
 	rtrs_srv_path_down(srv_path);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux