diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-18 12:30:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-18 12:30:07 -0400 |
commit | edd5f25f7475013b44f7942bb3b25022792a9c9d (patch) | |
tree | 6db5ebb2deb385b029158c5727835b5b71c9603b /fs | |
parent | d2d56c5f51028cb9f3d800882eb6f4cbd3f9099f (diff) | |
parent | 5e6e6232753482dc0024a319b9d8f611d7a80c19 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] Check return code on failed alloc
[CIFS] Update CIFS project web site
[CIFS] Fix hang in find_writable_file
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/CHANGES | 5 | ||||
-rw-r--r-- | fs/cifs/README | 13 | ||||
-rw-r--r-- | fs/cifs/TODO | 3 | ||||
-rw-r--r-- | fs/cifs/file.c | 33 | ||||
-rw-r--r-- | fs/cifs/sess.c | 4 |
5 files changed, 45 insertions, 13 deletions
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 | |||
3 | Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is | 3 | Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is |
4 | done with "serverino" mount option). Add support for POSIX Unlink | 4 | done 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 |
6 | Samba supports newer POSIX CIFS Protocol Extensions). | 6 | Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix" |
7 | mount option to allow disabling the CIFS Unix Extensions for just | ||
8 | that mount. Fix hang on spinlock in find_writable_file (race when | ||
9 | reopening file after session crash). | ||
7 | 10 | ||
8 | Version 1.49 | 11 | Version 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 | ||
83 | v) mount check for unmatched uids | 83 | v) mount check for unmatched uids |
84 | 84 | ||
85 | w) Add mount option for Linux extension disable per mount, and partial | 85 | w) Add support for new vfs entry points for setlease and fallocate |
86 | disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?) | ||
87 | 86 | ||
88 | x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of | 87 | x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of |
89 | processes can proceed better in parallel (on the server) | 88 | processes 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 | ||
1907 | static 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 */ |
1913 | int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) | 1932 | int 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; |