Skip to content

Commit 21b26d2

Browse files
committed
Merge tag '5.5-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs updates from Steve French: "Various smb3 fixes (including 12 for stable) and also features (addition of multichannel support)" * tag '5.5-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: (41 commits) CIFS: fix a white space issue in cifs_get_inode_info() cifs: update internal module version number cifs: Always update signing key of first channel cifs: Fix retrieval of DFS referrals in cifs_mount() cifs: Fix potential softlockups while refreshing DFS cache cifs: Fix lookup of root ses in DFS referral cache cifs: Fix use-after-free bug in cifs_reconnect() cifs: dump channel info in DebugData smb3: dump in_send and num_waiters stats counters by default cifs: try harder to open new channels CIFS: Properly process SMB3 lease breaks cifs: move cifsFileInfo_put logic into a work-queue cifs: try opening channels after mounting CIFS: refactor cifs_get_inode_info() cifs: switch servers depending on binding state cifs: add server param cifs: add multichannel mount options and data structs cifs: sort interface list by speed CIFS: Fix SMB2 oplock break processing cifs: don't use 'pre:' for MODULE_SOFTDEP ...
2 parents 8f45533 + 68464b8 commit 21b26d2

23 files changed

+1340
-529
lines changed

fs/cifs/cifs_debug.c

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,27 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
121121
seq_putc(m, '\n');
122122
}
123123

124+
static void
125+
cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
126+
{
127+
struct TCP_Server_Info *server = chan->server;
128+
129+
seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
130+
"TCP status: %d Instance: %d Local Users To Server: %d "
131+
"SecMode: 0x%x Req On Wire: %d In Send: %d "
132+
"In MaxReq Wait: %d\n",
133+
i+1,
134+
server->credits,
135+
server->dialect,
136+
server->tcpStatus,
137+
server->reconnect_instance,
138+
server->srv_count,
139+
server->sec_mode,
140+
in_flight(server),
141+
atomic_read(&server->in_send),
142+
atomic_read(&server->num_waiters));
143+
}
144+
124145
static void
125146
cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
126147
{
@@ -256,6 +277,11 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
256277
if (!server->rdma)
257278
goto skip_rdma;
258279

280+
if (!server->smbd_conn) {
281+
seq_printf(m, "\nSMBDirect transport not available");
282+
goto skip_rdma;
283+
}
284+
259285
seq_printf(m, "\nSMBDirect (in hex) protocol version: %x "
260286
"transport status: %x",
261287
server->smbd_conn->protocol,
@@ -360,18 +386,24 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
360386
server->srv_count,
361387
server->sec_mode, in_flight(server));
362388

363-
#ifdef CONFIG_CIFS_STATS2
364389
seq_printf(m, " In Send: %d In MaxReq Wait: %d",
365390
atomic_read(&server->in_send),
366391
atomic_read(&server->num_waiters));
367-
#endif
392+
368393
/* dump session id helpful for use with network trace */
369394
seq_printf(m, " SessionId: 0x%llx", ses->Suid);
370395
if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
371396
seq_puts(m, " encrypted");
372397
if (ses->sign)
373398
seq_puts(m, " signed");
374399

400+
if (ses->chan_count > 1) {
401+
seq_printf(m, "\n\n\tExtra Channels: %zu\n",
402+
ses->chan_count-1);
403+
for (j = 1; j < ses->chan_count; j++)
404+
cifs_dump_channel(m, j, &ses->chans[j]);
405+
}
406+
375407
seq_puts(m, "\n\tShares:");
376408
j = 0;
377409

@@ -410,8 +442,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
410442
seq_printf(m, "\n\tServer interfaces: %zu\n",
411443
ses->iface_count);
412444
for (j = 0; j < ses->iface_count; j++) {
445+
struct cifs_server_iface *iface;
446+
447+
iface = &ses->iface_list[j];
413448
seq_printf(m, "\t%d)", j);
414-
cifs_dump_iface(m, &ses->iface_list[j]);
449+
cifs_dump_iface(m, iface);
450+
if (is_ses_using_iface(ses, iface))
451+
seq_puts(m, "\t\t[CONNECTED]\n");
415452
}
416453
spin_unlock(&ses->iface_lock);
417454
}

fs/cifs/cifs_spnego.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct key_type cifs_spnego_key_type = {
9898
struct key *
9999
cifs_get_spnego_key(struct cifs_ses *sesInfo)
100100
{
101-
struct TCP_Server_Info *server = sesInfo->server;
101+
struct TCP_Server_Info *server = cifs_ses_server(sesInfo);
102102
struct sockaddr_in *sa = (struct sockaddr_in *) &server->dstaddr;
103103
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &server->dstaddr;
104104
char *description, *dp;

fs/cifs/cifsacl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ static const struct cifs_sid sid_everyone = {
3939
/* security id for Authenticated Users system group */
4040
static const struct cifs_sid sid_authusers = {
4141
1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(11)} };
42-
/* group users */
43-
static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
4442

4543
/* S-1-22-1 Unmapped Unix users */
4644
static const struct cifs_sid sid_unix_users = {1, 1, {0, 0, 0, 0, 0, 22},

fs/cifs/cifsfs.c

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ extern mempool_t *cifs_mid_poolp;
119119

120120
struct workqueue_struct *cifsiod_wq;
121121
struct workqueue_struct *decrypt_wq;
122+
struct workqueue_struct *fileinfo_put_wq;
122123
struct workqueue_struct *cifsoplockd_wq;
123124
__u32 cifs_lock_secret;
124125

@@ -613,6 +614,10 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
613614
/* convert actimeo and display it in seconds */
614615
seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);
615616

617+
if (tcon->ses->chan_max > 1)
618+
seq_printf(s, ",multichannel,max_channel=%zu",
619+
tcon->ses->chan_max);
620+
616621
return 0;
617622
}
618623

@@ -1219,6 +1224,7 @@ const struct file_operations cifs_file_ops = {
12191224
.open = cifs_open,
12201225
.release = cifs_close,
12211226
.lock = cifs_lock,
1227+
.flock = cifs_flock,
12221228
.fsync = cifs_fsync,
12231229
.flush = cifs_flush,
12241230
.mmap = cifs_file_mmap,
@@ -1238,6 +1244,7 @@ const struct file_operations cifs_file_strict_ops = {
12381244
.open = cifs_open,
12391245
.release = cifs_close,
12401246
.lock = cifs_lock,
1247+
.flock = cifs_flock,
12411248
.fsync = cifs_strict_fsync,
12421249
.flush = cifs_flush,
12431250
.mmap = cifs_file_strict_mmap,
@@ -1257,6 +1264,7 @@ const struct file_operations cifs_file_direct_ops = {
12571264
.open = cifs_open,
12581265
.release = cifs_close,
12591266
.lock = cifs_lock,
1267+
.flock = cifs_flock,
12601268
.fsync = cifs_fsync,
12611269
.flush = cifs_flush,
12621270
.mmap = cifs_file_mmap,
@@ -1554,11 +1562,18 @@ init_cifs(void)
15541562
goto out_destroy_cifsiod_wq;
15551563
}
15561564

1565+
fileinfo_put_wq = alloc_workqueue("cifsfileinfoput",
1566+
WQ_UNBOUND|WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
1567+
if (!fileinfo_put_wq) {
1568+
rc = -ENOMEM;
1569+
goto out_destroy_decrypt_wq;
1570+
}
1571+
15571572
cifsoplockd_wq = alloc_workqueue("cifsoplockd",
15581573
WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
15591574
if (!cifsoplockd_wq) {
15601575
rc = -ENOMEM;
1561-
goto out_destroy_decrypt_wq;
1576+
goto out_destroy_fileinfo_put_wq;
15621577
}
15631578

15641579
rc = cifs_fscache_register();
@@ -1624,6 +1639,8 @@ init_cifs(void)
16241639
cifs_fscache_unregister();
16251640
out_destroy_cifsoplockd_wq:
16261641
destroy_workqueue(cifsoplockd_wq);
1642+
out_destroy_fileinfo_put_wq:
1643+
destroy_workqueue(fileinfo_put_wq);
16271644
out_destroy_decrypt_wq:
16281645
destroy_workqueue(decrypt_wq);
16291646
out_destroy_cifsiod_wq:
@@ -1653,6 +1670,7 @@ exit_cifs(void)
16531670
cifs_fscache_unregister();
16541671
destroy_workqueue(cifsoplockd_wq);
16551672
destroy_workqueue(decrypt_wq);
1673+
destroy_workqueue(fileinfo_put_wq);
16561674
destroy_workqueue(cifsiod_wq);
16571675
cifs_proc_clean();
16581676
}
@@ -1663,17 +1681,17 @@ MODULE_DESCRIPTION
16631681
("VFS to access SMB3 servers e.g. Samba, Macs, Azure and Windows (and "
16641682
"also older servers complying with the SNIA CIFS Specification)");
16651683
MODULE_VERSION(CIFS_VERSION);
1666-
MODULE_SOFTDEP("pre: ecb");
1667-
MODULE_SOFTDEP("pre: hmac");
1668-
MODULE_SOFTDEP("pre: md4");
1669-
MODULE_SOFTDEP("pre: md5");
1670-
MODULE_SOFTDEP("pre: nls");
1671-
MODULE_SOFTDEP("pre: aes");
1672-
MODULE_SOFTDEP("pre: cmac");
1673-
MODULE_SOFTDEP("pre: sha256");
1674-
MODULE_SOFTDEP("pre: sha512");
1675-
MODULE_SOFTDEP("pre: aead2");
1676-
MODULE_SOFTDEP("pre: ccm");
1677-
MODULE_SOFTDEP("pre: gcm");
1684+
MODULE_SOFTDEP("ecb");
1685+
MODULE_SOFTDEP("hmac");
1686+
MODULE_SOFTDEP("md4");
1687+
MODULE_SOFTDEP("md5");
1688+
MODULE_SOFTDEP("nls");
1689+
MODULE_SOFTDEP("aes");
1690+
MODULE_SOFTDEP("cmac");
1691+
MODULE_SOFTDEP("sha256");
1692+
MODULE_SOFTDEP("sha512");
1693+
MODULE_SOFTDEP("aead2");
1694+
MODULE_SOFTDEP("ccm");
1695+
MODULE_SOFTDEP("gcm");
16781696
module_init(init_cifs)
16791697
module_exit(exit_cifs)

fs/cifs/cifsfs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ extern ssize_t cifs_strict_readv(struct kiocb *iocb, struct iov_iter *to);
108108
extern ssize_t cifs_user_writev(struct kiocb *iocb, struct iov_iter *from);
109109
extern ssize_t cifs_direct_writev(struct kiocb *iocb, struct iov_iter *from);
110110
extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);
111+
extern int cifs_flock(struct file *pfile, int cmd, struct file_lock *plock);
111112
extern int cifs_lock(struct file *, int, struct file_lock *);
112113
extern int cifs_fsync(struct file *, loff_t, loff_t, int);
113114
extern int cifs_strict_fsync(struct file *, loff_t, loff_t, int);
@@ -152,5 +153,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
152153
extern const struct export_operations cifs_export_ops;
153154
#endif /* CONFIG_CIFS_NFSD_EXPORT */
154155

155-
#define CIFS_VERSION "2.23"
156+
#define CIFS_VERSION "2.24"
156157
#endif /* _CIFSFS_H */

0 commit comments

Comments
 (0)