Skip to content

Commit 95baf63

Browse files
committed
Merge tag 'v6.18-rc5-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - Multichannel reconnect channel selection fix - Fix for smbdirect (RDMA) disconnect bug - Fix for incorrect username length check - Fix memory leak in mount parm processing * tag 'v6.18-rc5-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb: client: let smbd_disconnect_rdma_connection() turn CREATED into DISCONNECTED smb: fix invalid username check in smb3_fs_context_parse_param() cifs: client: fix memory leak in smb3_fs_context_parse_param smb: client: fix cifs_pick_channel when channel needs reconnect
2 parents 6da43bb + d93a896 commit 95baf63

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

fs/smb/client/fs_context.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,12 +1435,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
14351435
cifs_errorf(fc, "Unknown error parsing devname\n");
14361436
goto cifs_parse_mount_err;
14371437
}
1438+
kfree(ctx->source);
14381439
ctx->source = smb3_fs_context_fullpath(ctx, '/');
14391440
if (IS_ERR(ctx->source)) {
14401441
ctx->source = NULL;
14411442
cifs_errorf(fc, "OOM when copying UNC string\n");
14421443
goto cifs_parse_mount_err;
14431444
}
1445+
kfree(fc->source);
14441446
fc->source = kstrdup(ctx->source, GFP_KERNEL);
14451447
if (fc->source == NULL) {
14461448
cifs_errorf(fc, "OOM when copying UNC string\n");
@@ -1468,7 +1470,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
14681470
break;
14691471
}
14701472

1471-
if (strnlen(param->string, CIFS_MAX_USERNAME_LEN) >
1473+
if (strnlen(param->string, CIFS_MAX_USERNAME_LEN) ==
14721474
CIFS_MAX_USERNAME_LEN) {
14731475
pr_warn("username too long\n");
14741476
goto cifs_parse_mount_err;

fs/smb/client/smbdirect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ static void smbd_disconnect_rdma_connection(struct smbdirect_socket *sc)
290290
break;
291291

292292
case SMBDIRECT_SOCKET_CREATED:
293+
sc->status = SMBDIRECT_SOCKET_DISCONNECTED;
294+
break;
295+
293296
case SMBDIRECT_SOCKET_CONNECTED:
294297
sc->status = SMBDIRECT_SOCKET_ERROR;
295298
break;

fs/smb/client/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
830830
if (!server || server->terminate)
831831
continue;
832832

833-
if (CIFS_CHAN_NEEDS_RECONNECT(ses, i))
833+
if (CIFS_CHAN_NEEDS_RECONNECT(ses, cur))
834834
continue;
835835

836836
/*

0 commit comments

Comments
 (0)