diff options
-rw-r--r-- | MAINTAINERS | 2 | ||||
-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 |
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 M: sfrench@samba.org L: linux-cifs-client@lists.samba.org L: samba-technical@lists.samba.org -W: http://us1.samba.org/samba/Linux_CIFS_client.html +W: http://linux-cifs.samba.org/ T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git S: Supported 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 Fix NTLMv2 signing. NFS server mounted over cifs works (if cifs mount is done with "serverino" mount option). Add support for POSIX Unlink (helps with certain sharing violation cases when server such as -Samba supports newer POSIX CIFS Protocol Extensions). +Samba supports newer POSIX CIFS Protocol Extensions). Add "nounix" +mount option to allow disabling the CIFS Unix Extensions for just +that mount. Fix hang on spinlock in find_writable_file (race when +reopening file after session crash). Version 1.49 ------------ 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: noposixpaths If CIFS Unix extensions are supported, do not request posix path name support (this may cause servers to reject creatingfile with certain reserved characters). + nounix Disable the CIFS Unix Extensions for this mount (tree + connection). This is rarely needed, but it may be useful + in order to turn off multiple settings all at once (ie + posix acls, posix locks, posix paths, symlink support + and retrieving uids/gids/mode from the server) or to + work around a bug in server which implement the Unix + Extensions. nobrl Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most @@ -451,6 +458,12 @@ A partial list of the supported mount options follows: byte range locks). remount remount the share (often used to change from ro to rw mounts or vice versa) + servern Specify the server 's netbios name (RFC1001 name) to use + when attempting to setup a session to the server. This is + This is needed for mounting to some older servers (such + as OS/2 or Windows 98 and Windows ME) since they do not + support a default server name. A server name can be up + to 15 characters long and is usually uppercased. sfu When the CIFS Unix Extensions are not negotiated, attempt to create device files and fifos in a format compatible with 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 v) mount check for unmatched uids -w) Add mount option for Linux extension disable per mount, and partial -disable per mount (uid off, symlink/fifo/mknod on but what about posix acls?) +w) Add support for new vfs entry points for setlease and fallocate x) Fix Samba 3 server to handle Linux kernel aio so dbench with lots of 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) return rc; } +static int is_inode_writable(struct cifsInodeInfo *cifs_inode) +{ + struct cifsFileInfo *open_file; + + read_lock(&GlobalSMBSeslock); + list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { + if (open_file->closePend) + continue; + if (open_file->pfile && + ((open_file->pfile->f_flags & O_RDWR) || + (open_file->pfile->f_flags & O_WRONLY))) { + read_unlock(&GlobalSMBSeslock); + return 1; + } + } + read_unlock(&GlobalSMBSeslock); + return 0; +} + /* We do not want to update the file size from server for inodes open for write - to avoid races with writepage extending the file - in the future we could consider allowing @@ -1912,19 +1931,13 @@ static int cifs_readpage(struct file *file, struct page *page) page caching in the current Linux kernel design */ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) { - struct cifsFileInfo *open_file = NULL; - - if (cifsInode) - open_file = find_writable_file(cifsInode); + if (!cifsInode) + return 1; - if (open_file) { + if (is_inode_writable(cifsInode)) { + /* This inode is open for write at least once */ struct cifs_sb_info *cifs_sb; - /* there is not actually a write pending so let - this handle go free and allow it to - be closable if needed */ - atomic_dec(&open_file->wrtPending); - cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { /* 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, /* 2000 big enough to fit max user, domain, NOS name etc. */ str_area = kmalloc(2000, GFP_KERNEL); + if (str_area == NULL) { + cifs_small_buf_release(smb_buf); + return -ENOMEM; + } bcc_ptr = str_area; ses->flags &= ~CIFS_SES_LANMAN; |