提交 ac5e8814 编写于 作者: M Md Haris Iqbal 提交者: Jason Gunthorpe

RDMA/rtrs-clt: During add_path change for_new_clt according to path_num

When all the paths are removed for a session, the addition of the first
path is like a new session for the storage server.

Hence, for_new_clt has to be set to 1.

Link: https://lore.kernel.org/r/20210806112112.124313-2-haris.iqbal@ionos.comSigned-off-by: NMd Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: NJack Wang <jinpu.wang@ionos.com>
Reviewed-by: NLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
上级 1a010d73
......@@ -3082,6 +3082,18 @@ int rtrs_clt_create_path_from_sysfs(struct rtrs_clt *clt,
if (IS_ERR(sess))
return PTR_ERR(sess);
mutex_lock(&clt->paths_mutex);
if (clt->paths_num == 0) {
/*
* When all the paths are removed for a session,
* the addition of the first path is like a new session for
* the storage server
*/
sess->for_new_clt = 1;
}
mutex_unlock(&clt->paths_mutex);
/*
* It is totally safe to add path in CONNECTING state: coming
* IO will never grab it. Also it is very important to add
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册