]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: client: add multichannel async work for CONFIG_CIFS_DFS_UPCALL=n
authorHenrique Carvalho <henrique.carvalho@suse.com>
Mon, 19 Jan 2026 16:42:13 +0000 (13:42 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 8 Feb 2026 23:07:44 +0000 (17:07 -0600)
Multichannel support is independent of DFS configuration. Extend the
async multichannel setup to non-DFS cifs.ko.

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/connect.c

index d5661e9382d3119338900edc4c456bb9997d79f8..67dd0e9b9b11ab9f8f429888aea0cf4552d36d43 100644 (file)
@@ -4000,6 +4000,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
 {
        int rc = 0;
        struct cifs_mount_ctx mnt_ctx = { .cifs_sb = cifs_sb, .fs_ctx = ctx, };
+       struct mchan_mount *mchan_mount = NULL;
 
        rc = cifs_mount_get_session(&mnt_ctx);
        if (rc)
@@ -4027,14 +4028,27 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
        if (rc)
                goto error;
 
+       if (ctx->multichannel) {
+               mchan_mount = mchan_mount_alloc(mnt_ctx.ses);
+               if (IS_ERR(mchan_mount)) {
+                       rc = PTR_ERR(mchan_mount);
+                       goto error;
+               }
+       }
+
        rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon);
        if (rc)
                goto error;
 
+       if (ctx->multichannel)
+               queue_work(cifsiod_wq, &mchan_mount->work);
+
        free_xid(mnt_ctx.xid);
        return rc;
 
 error:
+       if (ctx->multichannel && !IS_ERR_OR_NULL(mchan_mount))
+               mchan_mount_free(mchan_mount);
        cifs_mount_put_conns(&mnt_ctx);
        return rc;
 }