Skip to content

Commit

Permalink
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
Pull CIFS updates from Steve French:
 "The most visible change in this set is the additional of multi-credit
  support for SMB2/SMB3 which dramatically improves the large file i/o
  performance for these dialects and significantly increases the maximum
  i/o size used on the wire for SMB2/SMB3.

  Also reconnection behavior after network failure is improved"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6: (35 commits)
  Add worker function to set allocation size
  [CIFS] Fix incorrect hex vs. decimal in some debug print statements
  update CIFS TODO list
  Add Pavel to contributor list in cifs AUTHORS file
  Update cifs version
  CIFS: Fix STATUS_CANNOT_DELETE error mapping for SMB2
  CIFS: Optimize readpages in a short read case on reconnects
  CIFS: Optimize cifs_user_read() in a short read case on reconnects
  CIFS: Improve indentation in cifs_user_read()
  CIFS: Fix possible buffer corruption in cifs_user_read()
  CIFS: Count got bytes in read_into_pages()
  CIFS: Use separate var for the number of bytes got in async read
  CIFS: Indicate reconnect with ECONNABORTED error code
  CIFS: Use multicredits for SMB 2.1/3 reads
  CIFS: Fix rsize usage for sync read
  CIFS: Fix rsize usage in user read
  CIFS: Separate page reading from user read
  CIFS: Fix rsize usage in readpages
  CIFS: Separate page search from readpages
  CIFS: Use multicredits for SMB 2.1/3 writes
  ...
  • Loading branch information
Linus Torvalds committed Aug 9, 2014
2 parents 63b12bd + f29ebb4 commit 023f78b
Show file tree
Hide file tree
Showing 20 changed files with 1,702 additions and 844 deletions.
1 change: 1 addition & 0 deletions Documentation/filesystems/cifs/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Gunter Kukkukk (testing and suggestions for support of old servers)
Igor Mammedov (DFS support)
Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code)
Scott Lovenberg
Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features)

Test case and Bug Report contributors
-------------------------------------
Expand Down
97 changes: 36 additions & 61 deletions Documentation/filesystems/cifs/TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.53 May 20, 2008
Version 2.03 August 1, 2014

A Partial List of Missing Features
==================================
Expand All @@ -7,123 +7,98 @@ Contributions are welcome. There are plenty of opportunities
for visible, important contributions to this module. Here
is a partial list of the known problems and missing features:

a) Support for SecurityDescriptors(Windows/CIFS ACLs) for chmod/chgrp/chown
so that these operations can be supported to Windows servers
a) SMB3 (and SMB3.02) missing optional features:
- RDMA
- multichannel (started)
- directory leases (improved metadata caching)
- T10 copy offload (copy chunk is only mechanism supported)
- encrypted shares

b) Mapping POSIX ACLs (and eventually NFSv4 ACLs) to CIFS
SecurityDescriptors
b) improved sparse file support

c) Better pam/winbind integration (e.g. to handle uid mapping
better)

d) Cleanup now unneeded SessSetup code in
fs/cifs/connect.c and add back in NTLMSSP code if any servers
need it

e) fix NTLMv2 signing when two mounts with different users to same
server.

f) Directory entry caching relies on a 1 second timer, rather than
c) Directory entry caching relies on a 1 second timer, rather than
using FindNotify or equivalent. - (started)

g) quota support (needs minor kernel change since quota calls
d) quota support (needs minor kernel change since quota calls
to make it to network filesystems or deviceless filesystems)

h) investigate sync behavior (including syncpage) and check
for proper behavior of intr/nointr

i) improve support for very old servers (OS/2 and Win9x for example)
e) improve support for very old servers (OS/2 and Win9x for example)
Including support for changing the time remotely (utimes command).

j) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
f) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
extra copy in/out of the socket buffers in some cases.

k) Better optimize open (and pathbased setfilesize) to reduce the
g) Better optimize open (and pathbased setfilesize) to reduce the
oplock breaks coming from windows srv. Piggyback identical file
opens on top of each other by incrementing reference count rather
than resending (helps reduce server resource utilization and avoid
spurious oplock breaks).

l) Improve performance of readpages by sending more than one read
at a time when 8 pages or more are requested. In conjuntion
add support for async_cifs_readpages.

m) Add support for storing symlink info to Windows servers
h) Add support for storing symlink info to Windows servers
in the Extended Attribute format their SFU clients would recognize.

n) Finish fcntl D_NOTIFY support so kde and gnome file list windows
i) Finish inotify support so kde and gnome file list windows
will autorefresh (partially complete by Asser). Needs minor kernel
vfs change to support removing D_NOTIFY on a file.

o) Add GUI tool to configure /proc/fs/cifs settings and for display of
j) Add GUI tool to configure /proc/fs/cifs settings and for display of
the CIFS statistics (started)

p) implement support for security and trusted categories of xattrs
k) implement support for security and trusted categories of xattrs
(requires minor protocol extension) to enable better support for SELINUX

q) Implement O_DIRECT flag on open (already supported on mount)
l) Implement O_DIRECT flag on open (already supported on mount)

r) Create UID mapping facility so server UIDs can be mapped on a per
m) Create UID mapping facility so server UIDs can be mapped on a per
mount or a per server basis to client UIDs or nobody if no mapping
exists. This is helpful when Unix extensions are negotiated to
allow better permission checking when UIDs differ on the server
and client. Add new protocol request to the CIFS protocol
standard for asking the server for the corresponding name of a
particular uid.

s) Add support for CIFS Unix and also the newer POSIX extensions to the
server side for Samba 4.
n) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for this too)

o) mount check for unmatched uids

t) In support for OS/2 (LANMAN 1.2 and LANMAN2.1 based SMB servers)
need to add ability to set time to server (utimes command)
p) Add support for new vfs entry point for fallocate

u) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for this too)
q) Add tools to take advantage of cifs/smb3 specific ioctls and features
such as "CopyChunk" (fast server side file copy)

v) mount check for unmatched uids
r) encrypted file support

w) Add support for new vfs entry point for fallocate
s) improved stats gathering, tools (perhaps integration with nfsometer?)

x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of
processes can proceed better in parallel (on the server)
t) allow setting more NTFS/SMB3 file attributes remotely (currently limited to compressed
file attribute via chflags)

y) Fix Samba 3 to handle reads/writes over 127K (and remove the cifs mount
restriction of wsize max being 127K)
u) mount helper GUI (to simplify the various configuration options on mount)

KNOWN BUGS (updated April 24, 2007)

KNOWN BUGS
====================================
See http://bugzilla.samba.org - search on product "CifsVFS" for
current bug list.
current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS)

1) existing symbolic links (Windows reparse points) are recognized but
can not be created remotely. They are implemented for Samba and those that
support the CIFS Unix extensions, although earlier versions of Samba
overly restrict the pathnames.
2) follow_link and readdir code does not follow dfs junctions
but recognizes them
3) create of new files to FAT partitions on Windows servers can
succeed but still return access denied (appears to be Windows
server not cifs client problem) and has not been reproduced recently.
NTFS partitions do not have this problem.
4) Unix/POSIX capabilities are reset after reconnection, and affect
a few fields in the tree connection but we do do not know which
superblocks to apply these changes to. We should probably walk
the list of superblocks to set these. Also need to check the
flags on the second mount to the same share, and see if we
can do the same trick that NFS does to remount duplicate shares.

Misc testing to do
==================
1) check out max path names and max path name components against various server
types. Try nested symlinks (8 deep). Return max path name in stat -f information

2) Modify file portion of ltp so it can run against a mounted network
share and run it against cifs vfs in automated fashion.
2) Improve xfstest's cifs enablement and adapt xfstests where needed to test
cifs better

3) Additional performance testing and optimization using iozone and similar -
there are some easy changes that can be done to parallelize sequential writes,
and when signing is disabled to request larger read sizes (larger than
negotiated size) and send larger write sizes to modern servers.

4) More exhaustively test against less common servers. More testing
against Windows 9x, Windows ME servers.

4) More exhaustively test against less common servers
2 changes: 1 addition & 1 deletion fs/cifs/cifs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
tcon->nativeFileSystem);
}
seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x"
"\n\tPathComponentMax: %d Status: 0x%d",
"\n\tPathComponentMax: %d Status: %d",
le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
le32_to_cpu(tcon->fsAttrInfo.Attributes),
le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
extern const struct export_operations cifs_export_ops;
#endif /* CONFIG_CIFS_NFSD_EXPORT */

#define CIFS_VERSION "2.03"
#define CIFS_VERSION "2.04"
#endif /* _CIFSFS_H */
19 changes: 19 additions & 0 deletions fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ struct smb_version_operations {
const struct cifs_fid *, u32 *);
int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *,
int);
/* writepages retry size */
unsigned int (*wp_retry_size)(struct inode *);
/* get mtu credits */
int (*wait_mtu_credits)(struct TCP_Server_Info *, unsigned int,
unsigned int *, unsigned int *);
};

struct smb_version_values {
Expand Down Expand Up @@ -639,6 +644,16 @@ add_credits(struct TCP_Server_Info *server, const unsigned int add,
server->ops->add_credits(server, add, optype);
}

static inline void
add_credits_and_wake_if(struct TCP_Server_Info *server, const unsigned int add,
const int optype)
{
if (add) {
server->ops->add_credits(server, add, optype);
wake_up(&server->request_q);
}
}

static inline void
set_credits(struct TCP_Server_Info *server, const int val)
{
Expand Down Expand Up @@ -1044,6 +1059,7 @@ struct cifs_readdata {
struct address_space *mapping;
__u64 offset;
unsigned int bytes;
unsigned int got_bytes;
pid_t pid;
int result;
struct work_struct work;
Expand All @@ -1053,6 +1069,7 @@ struct cifs_readdata {
struct kvec iov;
unsigned int pagesz;
unsigned int tailsz;
unsigned int credits;
unsigned int nr_pages;
struct page *pages[];
};
Expand All @@ -1073,6 +1090,7 @@ struct cifs_writedata {
int result;
unsigned int pagesz;
unsigned int tailsz;
unsigned int credits;
unsigned int nr_pages;
struct page *pages[];
};
Expand Down Expand Up @@ -1398,6 +1416,7 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param,
#define CIFS_OBREAK_OP 0x0100 /* oplock break request */
#define CIFS_NEG_OP 0x0200 /* negotiate request */
#define CIFS_OP_MASK 0x0380 /* mask request type */
#define CIFS_HAS_CREDITS 0x0400 /* already has credits */

/* Security Flags: indicate type of session setup needed */
#define CIFSSEC_MAY_SIGN 0x00001
Expand Down
4 changes: 4 additions & 0 deletions fs/cifs/cifsproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern struct smb_hdr *cifs_buf_get(void);
extern void cifs_buf_release(void *);
extern struct smb_hdr *cifs_small_buf_get(void);
extern void cifs_small_buf_release(void *);
extern void free_rsp_buf(int, void *);
extern void cifs_rqst_page_to_kvec(struct smb_rqst *rqst, unsigned int idx,
struct kvec *iov);
extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
Expand Down Expand Up @@ -89,6 +90,9 @@ extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *,
struct smb_rqst *);
extern int cifs_check_receive(struct mid_q_entry *mid,
struct TCP_Server_Info *server, bool log_error);
extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server,
unsigned int size, unsigned int *num,
unsigned int *credits);
extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
struct kvec *, int /* nvec to send */,
int * /* type of buf returned */ , const int flags);
Expand Down
Loading

0 comments on commit 023f78b

Please sign in to comment.