Skip to content

Commit 7a39682

Browse files
committed
Merge tag 'v6.8-rc-part2-smb-client' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client updates from Steve French: "Various smb client fixes, including multichannel and for SMB3.1.1 POSIX extensions: - debugging improvement (display start time for stats) - two reparse point handling fixes - various multichannel improvements and fixes - SMB3.1.1 POSIX extensions open/create parsing fix - retry (reconnect) improvement including new retrans mount parm, and handling of two additional return codes that need to be retried on - two minor cleanup patches and another to remove duplicate query info code - two documentation cleanup, and one reviewer email correction" * tag 'v6.8-rc-part2-smb-client' of git://git.samba.org/sfrench/cifs-2.6: cifs: update iface_last_update on each query-and-update cifs: handle servers that still advertise multichannel after disabling cifs: new mount option called retrans cifs: reschedule periodic query for server interfaces smb: client: don't clobber ->i_rdev from cached reparse points smb: client: get rid of smb311_posix_query_path_info() smb: client: parse owner/group when creating reparse points smb: client: fix parsing of SMB3.1.1 POSIX create context cifs: update known bugs mentioned in kernel docs for cifs cifs: new nt status codes from MS-SMB2 cifs: pick channel for tcon and tdis cifs: open_cached_dir should not rely on primary channel smb3: minor documentation updates Update MAINTAINERS email address cifs: minor comment cleanup smb3: show beginning time for per share stats cifs: remove redundant variable tcon_exist
2 parents 65163d1 + 78e727e commit 7a39682

File tree

19 files changed

+244
-257
lines changed

19 files changed

+244
-257
lines changed

Documentation/admin-guide/cifs/todo.rst

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
TODO
33
====
44

5-
Version 2.14 December 21, 2018
5+
As of 6.7 kernel. See https://wiki.samba.org/index.php/LinuxCIFSKernel
6+
for list of features added by release
67

78
A Partial List of Missing Features
89
==================================
@@ -12,22 +13,22 @@ for visible, important contributions to this module. Here
1213
is a partial list of the known problems and missing features:
1314

1415
a) SMB3 (and SMB3.1.1) missing optional features:
16+
multichannel performance optimizations, algorithmic channel selection,
17+
directory leases optimizations,
18+
support for faster packet signing (GMAC),
19+
support for compression over the network,
20+
T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl
21+
are currently the only two server side copy mechanisms supported)
1522

16-
- multichannel (partially integrated), integration of multichannel with RDMA
17-
- directory leases (improved metadata caching). Currently only implemented for root dir
18-
- T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl
19-
currently the only two server side copy mechanisms supported)
23+
b) Better optimized compounding and error handling for sparse file support,
24+
perhaps addition of new optional SMB3.1.1 fsctls to make collapse range
25+
and insert range more atomic
2026

21-
b) improved sparse file support (fiemap and SEEK_HOLE are implemented
22-
but additional features would be supportable by the protocol such
23-
as FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_INSERT_RANGE)
24-
25-
c) Directory entry caching relies on a 1 second timer, rather than
26-
using Directory Leases, currently only the root file handle is cached longer
27-
by leveraging Directory Leases
27+
c) Support for SMB3.1.1 over QUIC (and perhaps other socket based protocols
28+
like SCTP)
2829

2930
d) quota support (needs minor kernel change since quota calls otherwise
30-
won't make it to network filesystems or deviceless filesystems).
31+
won't make it to network filesystems or deviceless filesystems).
3132

3233
e) Additional use cases can be optimized to use "compounding" (e.g.
3334
open/query/close and open/setinfo/close) to reduce the number of
@@ -92,23 +93,20 @@ t) split cifs and smb3 support into separate modules so legacy (and less
9293

9394
v) Additional testing of POSIX Extensions for SMB3.1.1
9495

95-
w) Add support for additional strong encryption types, and additional spnego
96-
authentication mechanisms (see MS-SMB2). GCM-256 is now partially implemented.
96+
w) Support for the Mac SMB3.1.1 extensions to improve interop with Apple servers
97+
98+
x) Support for additional authentication options (e.g. IAKERB, peer-to-peer
99+
Kerberos, SCRAM and others supported by existing servers)
97100

98-
x) Finish support for SMB3.1.1 compression
101+
y) Improved tracing, more eBPF trace points, better scripts for performance
102+
analysis
99103

100104
Known Bugs
101105
==========
102106

103107
See https://bugzilla.samba.org - search on product "CifsVFS" for
104108
current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS)
105-
106-
1) existing symbolic links (Windows reparse points) are recognized but
107-
can not be created remotely. They are implemented for Samba and those that
108-
support the CIFS Unix extensions, although earlier versions of Samba
109-
overly restrict the pathnames.
110-
2) follow_link and readdir code does not follow dfs junctions
111-
but recognizes them
109+
and xfstest results e.g. https://wiki.samba.org/index.php/Xfstest-results-smb3
112110

113111
Misc testing to do
114112
==================

Documentation/admin-guide/cifs/usage.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ much older and less secure than the default dialect SMB3 which includes
8181
many advanced security features such as downgrade attack detection
8282
and encrypted shares and stronger signing and authentication algorithms.
8383
There are additional mount options that may be helpful for SMB3 to get
84-
improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1):
84+
improved POSIX behavior (NB: can use vers=3 to force SMB3 or later, never 2.1):
8585

8686
``mfsymlinks`` and either ``cifsacl`` or ``modefromsid`` (usually with ``idsfromsid``)
8787

@@ -715,6 +715,7 @@ DebugData Displays information about active CIFS sessions and
715715
Stats Lists summary resource usage information as well as per
716716
share statistics.
717717
open_files List all the open file handles on all active SMB sessions.
718+
mount_params List of all mount parameters available for the module
718719
======================= =======================================================
719720

720721
Configuration pseudo-files:
@@ -864,6 +865,11 @@ i.e.::
864865

865866
echo "value" > /sys/module/cifs/parameters/<param>
866867

868+
More detailed descriptions of the available module parameters and their values
869+
can be seen by doing:
870+
871+
modinfo cifs (or modinfo smb3)
872+
867873
================= ==========================================================
868874
1. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default.
869875
[Y/y/1]. To disable use any of [N/n/0].

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5236,7 +5236,7 @@ X: drivers/clk/clkdev.c
52365236
COMMON INTERNET FILE SYSTEM CLIENT (CIFS and SMB3)
52375237
M: Steve French <sfrench@samba.org>
52385238
R: Paulo Alcantara <pc@manguebit.com> (DFS, global name space)
5239-
R: Ronnie Sahlberg <lsahlber@redhat.com> (directory leases, sparse files)
5239+
R: Ronnie Sahlberg <ronniesahlberg@gmail.com> (directory leases, sparse files)
52405240
R: Shyam Prasad N <sprasad@microsoft.com> (multichannel)
52415241
R: Tom Talpey <tom@talpey.com> (RDMA, smbdirect)
52425242
L: linux-cifs@vger.kernel.org

fs/smb/client/cached_dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
151151
return -EOPNOTSUPP;
152152

153153
ses = tcon->ses;
154-
server = ses->server;
154+
server = cifs_pick_channel(ses);
155155
cfids = tcon->cfids;
156156

157157
if (!server->ops->new_lease_key)

fs/smb/client/cifs_debug.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
659659
spin_lock(&tcon->stat_lock);
660660
tcon->bytes_read = 0;
661661
tcon->bytes_written = 0;
662+
tcon->stats_from_time = ktime_get_real_seconds();
662663
spin_unlock(&tcon->stat_lock);
663664
if (server->ops->clear_stats)
664665
server->ops->clear_stats(tcon);
@@ -737,8 +738,9 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
737738
seq_printf(m, "\n%d) %s", i, tcon->tree_name);
738739
if (tcon->need_reconnect)
739740
seq_puts(m, "\tDISCONNECTED ");
740-
seq_printf(m, "\nSMBs: %d",
741-
atomic_read(&tcon->num_smbs_sent));
741+
seq_printf(m, "\nSMBs: %d since %ptTs UTC",
742+
atomic_read(&tcon->num_smbs_sent),
743+
&tcon->stats_from_time);
742744
if (server->ops->print_stats)
743745
server->ops->print_stats(m, tcon);
744746
}

fs/smb/client/cifsfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
681681
seq_printf(s, ",rasize=%u", cifs_sb->ctx->rasize);
682682
if (tcon->ses->server->min_offload)
683683
seq_printf(s, ",esize=%u", tcon->ses->server->min_offload);
684+
if (tcon->ses->server->retrans)
685+
seq_printf(s, ",retrans=%u", tcon->ses->server->retrans);
684686
seq_printf(s, ",echo_interval=%lu",
685687
tcon->ses->server->echo_interval / HZ);
686688

fs/smb/client/cifsglob.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ struct cifs_open_info_data {
204204
};
205205
} reparse;
206206
char *symlink_target;
207+
struct cifs_sid posix_owner;
208+
struct cifs_sid posix_group;
207209
union {
208210
struct smb2_file_all_info fi;
209211
struct smb311_posix_qinfo posix_fi;
@@ -751,6 +753,7 @@ struct TCP_Server_Info {
751753
unsigned int max_read;
752754
unsigned int max_write;
753755
unsigned int min_offload;
756+
unsigned int retrans;
754757
__le16 compress_algorithm;
755758
__u16 signing_algorithm;
756759
__le16 cipher_type;
@@ -1207,6 +1210,7 @@ struct cifs_tcon {
12071210
__u64 bytes_read;
12081211
__u64 bytes_written;
12091212
spinlock_t stat_lock; /* protects the two fields above */
1213+
time64_t stats_from_time;
12101214
FILE_SYSTEM_DEVICE_INFO fsDevInfo;
12111215
FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */
12121216
FILE_SYSTEM_UNIX_INFO fsUnixInfo;

fs/smb/client/connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,9 @@ static int match_server(struct TCP_Server_Info *server,
15741574
if (server->min_offload != ctx->min_offload)
15751575
return 0;
15761576

1577+
if (server->retrans != ctx->retrans)
1578+
return 0;
1579+
15771580
return 1;
15781581
}
15791582

@@ -1798,6 +1801,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
17981801
goto out_err_crypto_release;
17991802
}
18001803
tcp_ses->min_offload = ctx->min_offload;
1804+
tcp_ses->retrans = ctx->retrans;
18011805
/*
18021806
* at this point we are the only ones with the pointer
18031807
* to the struct since the kernel thread not created yet

fs/smb/client/fs_context.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
139139
fsparam_u32("dir_mode", Opt_dirmode),
140140
fsparam_u32("port", Opt_port),
141141
fsparam_u32("min_enc_offload", Opt_min_enc_offload),
142+
fsparam_u32("retrans", Opt_retrans),
142143
fsparam_u32("esize", Opt_min_enc_offload),
143144
fsparam_u32("bsize", Opt_blocksize),
144145
fsparam_u32("rasize", Opt_rasize),
@@ -1064,6 +1065,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
10641065
case Opt_min_enc_offload:
10651066
ctx->min_offload = result.uint_32;
10661067
break;
1068+
case Opt_retrans:
1069+
ctx->retrans = result.uint_32;
1070+
break;
10671071
case Opt_blocksize:
10681072
/*
10691073
* inode blocksize realistically should never need to be
@@ -1619,6 +1623,8 @@ int smb3_init_fs_context(struct fs_context *fc)
16191623
ctx->backupuid_specified = false; /* no backup intent for a user */
16201624
ctx->backupgid_specified = false; /* no backup intent for a group */
16211625

1626+
ctx->retrans = 1;
1627+
16221628
/*
16231629
* short int override_uid = -1;
16241630
* short int override_gid = -1;

fs/smb/client/fs_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ enum cifs_param {
118118
Opt_file_mode,
119119
Opt_dirmode,
120120
Opt_min_enc_offload,
121+
Opt_retrans,
121122
Opt_blocksize,
122123
Opt_rasize,
123124
Opt_rsize,
@@ -245,6 +246,7 @@ struct smb3_fs_context {
245246
unsigned int rsize;
246247
unsigned int wsize;
247248
unsigned int min_offload;
249+
unsigned int retrans;
248250
bool sockopt_tcp_nodelay:1;
249251
/* attribute cache timemout for files and directories in jiffies */
250252
unsigned long acregmax;

0 commit comments

Comments
 (0)