aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-rw-r--r--fs/cifs/CHANGES5
-rw-r--r--fs/cifs/README13
-rw-r--r--fs/cifs/TODO3
-rw-r--r--fs/cifs/file.c33
-rw-r--r--fs/cifs/sess.c4
6 files changed, 46 insertions, 14 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index e4dde7f1f8d2..371fe67a4eef 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1009,7 +1009,7 @@ P: Steve French
1009M: sfrench@samba.org 1009M: sfrench@samba.org
1010L: linux-cifs-client@lists.samba.org 1010L: linux-cifs-client@lists.samba.org
1011L: samba-technical@lists.samba.org 1011L: samba-technical@lists.samba.org
1012W: http://us1.samba.org/samba/Linux_CIFS_client.html 1012W: http://linux-cifs.samba.org/
1013T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git 1013T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
1014S: Supported 1014S: Supported
1015 1015
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 6d84ca2beead..bed6215c0794 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -3,7 +3,10 @@ Version 1.50
3Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is 3Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is
4done with "serverino" mount option). Add support for POSIX Unlink 4done with "serverino" mount option). Add support for POSIX Unlink
5(helps with certain sharing violation cases when server such as 5(helps with certain sharing violation cases when server such as
6Samba supports newer POSIX CIFS Protocol Extensions). 6Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix"
7mount option to allow disabling the CIFS Unix Extensions for just
8that mount. Fix hang on spinlock in find_writable_file (race when
9reopening file after session crash).
7 10
8Version 1.49 11Version 1.49
9------------ 12------------
diff --git a/fs/cifs/README b/fs/cifs/README
index 85f1eb14083e..b806b11b5560 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -444,6 +444,13 @@ A partial list of the supported mount options follows:
444 noposixpaths If CIFS Unix extensions are supported, do not request 444 noposixpaths If CIFS Unix extensions are supported, do not request
445 posix path name support (this may cause servers to 445 posix path name support (this may cause servers to
446 reject creatingfile with certain reserved characters). 446 reject creatingfile with certain reserved characters).
447 nounix Disable the CIFS Unix Extensions for this mount (tree
448 connection). This is rarely needed, but it may be useful
449 in order to turn off multiple settings all at once (ie
450 posix acls, posix locks, posix paths, symlink support
451 and retrieving uids/gids/mode from the server) or to
452 work around a bug in server which implement the Unix
453 Extensions.
447 nobrl Do not send byte range lock requests to the server. 454 nobrl Do not send byte range lock requests to the server.
448 This is necessary for certain applications that break 455 This is necessary for certain applications that break
449 with cifs style mandatory byte range locks (and most 456 with cifs style mandatory byte range locks (and most
@@ -451,6 +458,12 @@ A partial list of the supported mount options follows:
451 byte range locks). 458 byte range locks).
452 remount remount the share (often used to change from ro to rw mounts 459 remount remount the share (often used to change from ro to rw mounts
453 or vice versa) 460 or vice versa)
461 servern Specify the server 's netbios name (RFC1001 name) to use
462 when attempting to setup a session to the server. This is
463 This is needed for mounting to some older servers (such
464 as OS/2 or Windows 98 and Windows ME) since they do not
465 support a default server name. A server name can be up
466 to 15 characters long and is usually uppercased.
454 sfu When the CIFS Unix Extensions are not negotiated, attempt to 467 sfu When the CIFS Unix Extensions are not negotiated, attempt to
455 create device files and fifos in a format compatible with 468 create device files and fifos in a format compatible with
456 Services for Unix (SFU). In addition retrieve bits 10-12 469 Services for Unix (SFU). In addition retrieve bits 10-12
diff --git a/fs/cifs/TODO b/fs/cifs/TODO
index d7bd51575fd6..29d4b2715254 100644
--- a/fs/cifs/TODO
+++ b/fs/cifs/TODO
@@ -82,8 +82,7 @@ u) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for
82 82
83v) mount check for unmatched uids 83v) mount check for unmatched uids
84 84
85w) Add mount option for Linux extension disable per mount, and partial 85w) Add support for new vfs entry points for setlease and fallocate
86disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?)
87 86
88x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of 87x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of
89processes can proceed better in parallel (on the server) 88processes can proceed better in parallel (on the server)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e13592afca9c..894b1f7b299d 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1904,6 +1904,25 @@ static int cifs_readpage(struct file *file, struct page *page)
1904 return rc; 1904 return rc;
1905} 1905}
1906 1906
1907static int is_inode_writable(struct cifsInodeInfo *cifs_inode)
1908{
1909 struct cifsFileInfo *open_file;
1910
1911 read_lock(&GlobalSMBSeslock);
1912 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
1913 if (open_file->closePend)
1914 continue;
1915 if (open_file->pfile &&
1916 ((open_file->pfile->f_flags & O_RDWR) ||
1917 (open_file->pfile->f_flags & O_WRONLY))) {
1918 read_unlock(&GlobalSMBSeslock);
1919 return 1;
1920 }
1921 }
1922 read_unlock(&GlobalSMBSeslock);
1923 return 0;
1924}
1925
1907/* We do not want to update the file size from server for inodes 1926/* We do not want to update the file size from server for inodes
1908 open for write - to avoid races with writepage extending 1927 open for write - to avoid races with writepage extending
1909 the file - in the future we could consider allowing 1928 the file - in the future we could consider allowing
@@ -1912,19 +1931,13 @@ static int cifs_readpage(struct file *file, struct page *page)
1912 page caching in the current Linux kernel design */ 1931 page caching in the current Linux kernel design */
1913int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) 1932int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
1914{ 1933{
1915 struct cifsFileInfo *open_file = NULL; 1934 if (!cifsInode)
1916 1935 return 1;
1917 if (cifsInode)
1918 open_file = find_writable_file(cifsInode);
1919 1936
1920 if (open_file) { 1937 if (is_inode_writable(cifsInode)) {
1938 /* This inode is open for write at least once */
1921 struct cifs_sb_info *cifs_sb; 1939 struct cifs_sb_info *cifs_sb;
1922 1940
1923 /* there is not actually a write pending so let
1924 this handle go free and allow it to
1925 be closable if needed */
1926 atomic_dec(&open_file->wrtPending);
1927
1928 cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); 1941 cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
1929 if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { 1942 if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) {
1930 /* since no page cache to corrupt on directio 1943 /* since no page cache to corrupt on directio
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 2ea027dda215..892be9b4d1f3 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -372,6 +372,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
372 372
373 /* 2000 big enough to fit max user, domain, NOS name etc. */ 373 /* 2000 big enough to fit max user, domain, NOS name etc. */
374 str_area = kmalloc(2000, GFP_KERNEL); 374 str_area = kmalloc(2000, GFP_KERNEL);
375 if (str_area == NULL) {
376 cifs_small_buf_release(smb_buf);
377 return -ENOMEM;
378 }
375 bcc_ptr = str_area; 379 bcc_ptr = str_area;
376 380
377 ses->flags &= ~CIFS_SES_LANMAN; 381 ses->flags &= ~CIFS_SES_LANMAN;