This is a note to let you know that I've just added the patch titled RDMA/rtrs-srv: Use sysfs_remove_file_self for disconnect to the 5.10-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-use-sysfs_remove_file_self-for-disconn.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 00399586ae7efc0cc841619008edd2787a899e9a Author: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxx> Date: Thu Dec 17 15:19:00 2020 +0100 RDMA/rtrs-srv: Use sysfs_remove_file_self for disconnect [ Upstream commit f991fdac813f1598a9bb17b602ce04812ba9148c ] Remove self first to avoid deadlock, we don't want to use close_work to remove sess sysfs. Fixes: 91b11610af8d ("RDMA/rtrs: server: sysfs interface functions") Link: https://lore.kernel.org/r/20201217141915.56989-5-jinpu.wang@xxxxxxxxxxxxxxx Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxx> Tested-by: Lutz Pogrell <lutz.pogrell@xxxxxxxxxxxxxxx> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c index 07fbb063555d3..3c5dfe21bba68 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c @@ -53,6 +53,8 @@ static ssize_t rtrs_srv_disconnect_store(struct kobject *kobj, sockaddr_to_str((struct sockaddr *)&sess->s.dst_addr, str, sizeof(str)); rtrs_info(s, "disconnect for path %s requested\n", str); + /* first remove sysfs itself to avoid deadlock */ + sysfs_remove_file_self(&sess->kobj, &attr->attr); close_sess(sess); return count;