]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: fix missed refcounting of ipc tcon
authorPaulo Alcantara <pc@cjr.nz>
Thu, 2 Dec 2021 18:29:35 +0000 (15:29 -0300)
committerSteve French <stfrench@microsoft.com>
Fri, 3 Dec 2021 18:29:10 +0000 (12:29 -0600)
Fix missed refcounting of IPC tcon used for getting domain-based DFS
root referrals.  We want to keep it alive as long as mount is active
and can be refreshed.  For standalone DFS root referrals it wouldn't
be a problem as the client ends up having an IPC tcon for both mount
and cache.

Fixes: 631f7087f623 ("cifs: support nested dfs links over reconnect")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c

index 6b705026da1a37d238348e0fefe06f022913bfe9..90f38fb9baa09c980dcbc5ff01676b5ba3f216f7 100644 (file)
@@ -3426,6 +3426,7 @@ static int connect_dfs_root(struct mount_ctx *mnt_ctx, struct dfs_cache_tgt_list
         */
        mount_put_conns(mnt_ctx);
        mount_get_dfs_conns(mnt_ctx);
+       set_root_ses(mnt_ctx);
 
        full_path = build_unc_path_to_root(ctx, cifs_sb, true);
        if (IS_ERR(full_path))