Skip to content

Commit b97d64c

Browse files
committed
Merge tag '6.6-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client updates from Steve French: - fixes for excessive stack usage - multichannel reconnect improvements - DFS fix and cleanup patches - move UCS-2 conversion code to fs/nls and update cifs and jfs to use them - cleanup patch for compounding, one to fix confusing function name - inode number collision fix - reparse point fixes (including avoiding an extra unneeded query on symlinks) and a minor cleanup - directory lease (caching) improvement * tag '6.6-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: (24 commits) fs/jfs: Use common ucs2 upper case table fs/smb/client: Use common code in client fs/smb: Swing unicode common code from smb->NLS fs/smb: Remove unicode 'lower' tables SMB3: rename macro CIFS_SERVER_IS_CHAN to avoid confusion [SMB3] send channel sequence number in SMB3 requests after reconnects cifs: update desired access while requesting for directory lease smb: client: reduce stack usage in smb2_query_reparse_point() smb: client: reduce stack usage in smb2_query_info_compound() smb: client: reduce stack usage in smb2_set_ea() smb: client: reduce stack usage in smb_send_rqst() smb: client: reduce stack usage in cifs_demultiplex_thread() smb: client: reduce stack usage in cifs_try_adding_channels() smb: cilent: set reparse mount points as automounts smb: client: query reparse points in older dialects smb: client: do not query reparse points twice on symlinks smb: client: parse reparse point flag in create response smb: client: get rid of dfs code dep in namespace.c smb: client: get rid of dfs naming in automount code smb: client: rename cifs_dfs_ref.c to namespace.c ...
2 parents 47d154e + f3a9b37 commit b97d64c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1377
-2021
lines changed

fs/jfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config JFS_FS
33
tristate "JFS filesystem support"
44
select BUFFER_HEAD
55
select NLS
6+
select NLS_UCS2_UTILS
67
select CRC32
78
select LEGACY_DIRECT_IO
89
help

fs/jfs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jfs-y := super.o file.o inode.o namei.o jfs_mount.o jfs_umount.o \
99
jfs_xtree.o jfs_imap.o jfs_debug.o jfs_dmap.o \
1010
jfs_unicode.o jfs_dtree.o jfs_inode.o jfs_discard.o \
1111
jfs_extent.o symlink.o jfs_metapage.o \
12-
jfs_logmgr.o jfs_txnmgr.o jfs_uniupr.o \
12+
jfs_logmgr.o jfs_txnmgr.o \
1313
resize.o xattr.o ioctl.o
1414

1515
jfs-$(CONFIG_JFS_POSIX_ACL) += acl.o

fs/jfs/jfs_unicode.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,9 @@
88

99
#include <linux/slab.h>
1010
#include <asm/byteorder.h>
11+
#include "../nls/nls_ucs2_data.h"
1112
#include "jfs_types.h"
1213

13-
typedef struct {
14-
wchar_t start;
15-
wchar_t end;
16-
signed char *table;
17-
} UNICASERANGE;
18-
19-
extern signed char UniUpperTable[512];
20-
extern UNICASERANGE UniUpperRange[];
2114
extern int get_UCSname(struct component_name *, struct dentry *);
2215
extern int jfs_strfromUCS_le(char *, const __le16 *, int, struct nls_table *);
2316

@@ -107,12 +100,12 @@ static inline wchar_t *UniStrncpy_from_le(wchar_t * ucs1, const __le16 * ucs2,
107100
*/
108101
static inline wchar_t UniToupper(wchar_t uc)
109102
{
110-
UNICASERANGE *rp;
103+
const struct UniCaseRange *rp;
111104

112-
if (uc < sizeof(UniUpperTable)) { /* Latin characters */
113-
return uc + UniUpperTable[uc]; /* Use base tables */
105+
if (uc < sizeof(NlsUniUpperTable)) { /* Latin characters */
106+
return uc + NlsUniUpperTable[uc]; /* Use base tables */
114107
} else {
115-
rp = UniUpperRange; /* Use range tables */
108+
rp = NlsUniUpperRange; /* Use range tables */
116109
while (rp->start) {
117110
if (uc < rp->start) /* Before start of range */
118111
return uc; /* Uppercase = input */

fs/jfs/jfs_uniupr.c

Lines changed: 0 additions & 121 deletions
This file was deleted.

fs/nls/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,4 +617,12 @@ config NLS_UTF8
617617
input/output character sets. Say Y here for the UTF-8 encoding of
618618
the Unicode/ISO9646 universal character set.
619619

620+
config NLS_UCS2_UTILS
621+
tristate "NLS UCS-2 UTILS"
622+
help
623+
Set of older UCS-2 conversion utilities and tables used by some
624+
filesystems including SMB/CIFS. This includes upper case conversion
625+
tables. This will automatically be selected when the filesystem
626+
that uses it is selected.
627+
620628
endif # NLS

fs/nls/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ obj-$(CONFIG_NLS_MAC_INUIT) += mac-inuit.o
5454
obj-$(CONFIG_NLS_MAC_ROMANIAN) += mac-romanian.o
5555
obj-$(CONFIG_NLS_MAC_ROMAN) += mac-roman.o
5656
obj-$(CONFIG_NLS_MAC_TURKISH) += mac-turkish.o
57+
obj-$(CONFIG_NLS_UCS2_UTILS) += nls_ucs2_utils.o

fs/nls/nls_ucs2_data.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
3+
#ifndef _NLS_UCS2_DATA_H
4+
#define _NLS_UCS2_DATA_H
5+
6+
struct UniCaseRange {
7+
wchar_t start;
8+
wchar_t end;
9+
signed char *table;
10+
};
11+
12+
extern signed char NlsUniUpperTable[512];
13+
extern const struct UniCaseRange NlsUniUpperRange[];
14+
15+
#endif /* _NLS_UCS2_DATA_H */
Lines changed: 17 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
/* SPDX-License-Identifier: GPL-2.0-or-later */
1+
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* Some of the source code in this file came from fs/cifs/uniupr.h
44
* Copyright (c) International Business Machines Corp., 2000,2002
55
*
6-
* uniupr.h - Unicode compressed case ranges
6+
* Some of the source code in this file came from fs/cifs/cifs_unicode.c
7+
*
8+
* Copyright (c) International Business Machines Corp., 2000,2009
9+
* Modified by Steve French ([email protected])
10+
* Modified by Namjae Jeon ([email protected])
711
*
812
*/
9-
#ifndef __KSMBD_UNIUPR_H
10-
#define __KSMBD_UNIUPR_H
13+
#include <linux/fs.h>
14+
#include <linux/module.h>
15+
#include <linux/slab.h>
16+
#include <asm/unaligned.h>
17+
#include "nls_ucs2_utils.h"
18+
19+
MODULE_LICENSE("GPL");
1120

12-
#ifndef UNIUPR_NOUPPER
1321
/*
1422
* Latin upper case
1523
*/
16-
signed char SmbUniUpperTable[512] = {
24+
signed char NlsUniUpperTable[512] = {
1725
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 000-00f */
1826
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 010-01f */
1927
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 020-02f */
@@ -51,6 +59,7 @@ signed char SmbUniUpperTable[512] = {
5159
0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, /* 1e0-1ef */
5260
0, 0, -1, -2, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, /* 1f0-1ff */
5361
};
62+
EXPORT_SYMBOL_GPL(NlsUniUpperTable);
5463

5564
/* Upper case range - Greek */
5665
static signed char UniCaseRangeU03a0[47] = {
@@ -126,143 +135,12 @@ static signed char UniCaseRangeUff40[27] = {
126135
/*
127136
* Upper Case Range
128137
*/
129-
const struct UniCaseRange SmbUniUpperRange[] = {
138+
const struct UniCaseRange NlsUniUpperRange[] = {
130139
{0x03a0, 0x03ce, UniCaseRangeU03a0},
131140
{0x0430, 0x045f, UniCaseRangeU0430},
132141
{0x0490, 0x04cc, UniCaseRangeU0490},
133142
{0x1e00, 0x1ffc, UniCaseRangeU1e00},
134143
{0xff40, 0xff5a, UniCaseRangeUff40},
135144
{0}
136145
};
137-
#endif
138-
139-
#ifndef UNIUPR_NOLOWER
140-
/*
141-
* Latin lower case
142-
*/
143-
signed char CifsUniLowerTable[512] = {
144-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 000-00f */
145-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 010-01f */
146-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 020-02f */
147-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 030-03f */
148-
0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
149-
32, 32, 32, /* 040-04f */
150-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0,
151-
0, 0, 0, /* 050-05f */
152-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 060-06f */
153-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 070-07f */
154-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 080-08f */
155-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 090-09f */
156-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0a0-0af */
157-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0b0-0bf */
158-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
159-
32, 32, 32, 32, /* 0c0-0cf */
160-
32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32,
161-
32, 32, 32, 0, /* 0d0-0df */
162-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0e0-0ef */
163-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0f0-0ff */
164-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 100-10f */
165-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 110-11f */
166-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 120-12f */
167-
0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, /* 130-13f */
168-
0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, /* 140-14f */
169-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 150-15f */
170-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 160-16f */
171-
1, 0, 1, 0, 1, 0, 1, 0, -121, 1, 0, 1, 0, 1, 0,
172-
0, /* 170-17f */
173-
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 79,
174-
0, /* 180-18f */
175-
0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, /* 190-19f */
176-
1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, /* 1a0-1af */
177-
0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, /* 1b0-1bf */
178-
0, 0, 0, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 1, 0, 1, /* 1c0-1cf */
179-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, /* 1d0-1df */
180-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e0-1ef */
181-
0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1f0-1ff */
182-
};
183-
184-
/* Lower case range - Greek */
185-
static signed char UniCaseRangeL0380[44] = {
186-
0, 0, 0, 0, 0, 0, 38, 0, 37, 37, 37, 0, 64, 0, 63, 63, /* 380-38f */
187-
0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
188-
32, 32, 32, /* 390-39f */
189-
32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32,
190-
};
191-
192-
/* Lower case range - Cyrillic */
193-
static signed char UniCaseRangeL0400[48] = {
194-
0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
195-
0, 80, 80, /* 400-40f */
196-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
197-
32, 32, 32, /* 410-41f */
198-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
199-
32, 32, 32, /* 420-42f */
200-
};
201-
202-
/* Lower case range - Extended cyrillic */
203-
static signed char UniCaseRangeL0490[60] = {
204-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 490-49f */
205-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 4a0-4af */
206-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 4b0-4bf */
207-
0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
208-
};
209-
210-
/* Lower case range - Extended latin and greek */
211-
static signed char UniCaseRangeL1e00[504] = {
212-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e00-1e0f */
213-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e10-1e1f */
214-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e20-1e2f */
215-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e30-1e3f */
216-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e40-1e4f */
217-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e50-1e5f */
218-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e60-1e6f */
219-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e70-1e7f */
220-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1e80-1e8f */
221-
1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, /* 1e90-1e9f */
222-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1ea0-1eaf */
223-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1eb0-1ebf */
224-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1ec0-1ecf */
225-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1ed0-1edf */
226-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, /* 1ee0-1eef */
227-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, /* 1ef0-1eff */
228-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f00-1f0f */
229-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, /* 1f10-1f1f */
230-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f20-1f2f */
231-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f30-1f3f */
232-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, /* 1f40-1f4f */
233-
0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, -8, 0, -8, 0, -8, /* 1f50-1f5f */
234-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f60-1f6f */
235-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1f70-1f7f */
236-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f80-1f8f */
237-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1f90-1f9f */
238-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, /* 1fa0-1faf */
239-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -74, -74, -9, 0, 0, 0, /* 1fb0-1fbf */
240-
0, 0, 0, 0, 0, 0, 0, 0, -86, -86, -86, -86, -9, 0,
241-
0, 0, /* 1fc0-1fcf */
242-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -100, -100, 0, 0, 0, 0, /* 1fd0-1fdf */
243-
0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -112, -112, -7, 0,
244-
0, 0, /* 1fe0-1fef */
245-
0, 0, 0, 0, 0, 0, 0, 0,
246-
};
247-
248-
/* Lower case range - Wide latin */
249-
static signed char UniCaseRangeLff20[27] = {
250-
0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
251-
32, /* ff20-ff2f */
252-
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
253-
};
254-
255-
/*
256-
* Lower Case Range
257-
*/
258-
const struct UniCaseRange CifsUniLowerRange[] = {
259-
{0x0380, 0x03ab, UniCaseRangeL0380},
260-
{0x0400, 0x042f, UniCaseRangeL0400},
261-
{0x0490, 0x04cb, UniCaseRangeL0490},
262-
{0x1e00, 0x1ff7, UniCaseRangeL1e00},
263-
{0xff20, 0xff3a, UniCaseRangeLff20},
264-
{0}
265-
};
266-
#endif
267-
268-
#endif /* __KSMBD_UNIUPR_H */
146+
EXPORT_SYMBOL_GPL(NlsUniUpperRange);

0 commit comments

Comments
 (0)