summaryrefslogtreecommitdiffstats
path: root/fs/cifs
Commit message (Collapse)AuthorAgeFilesLines
* cifs: fix misannotationsAl Viro2008-03-301-2/+2
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] do shrink_submounts() for all fs typesAl Viro2008-03-271-1/+0
| | | | | | | | | ... and take it out of ->umount_begin() instances. Call with all locks already taken (by do_umount()) and leave calling release_mounts() to caller (it will do release_mounts() anyway, so we can just put into the same list). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* [CIFS] Fix mem leak on dfs referralSteve French2008-03-221-2/+8
| | | | | Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] file create with acl support enabled is slowSteve French2008-03-146-22/+30
| | | | | | | | | | | | | | | | Shirish Pargaonkar noted: With cifsacl mount option, when a file is created on the Windows server, exclusive oplock is broken right away because the get cifs acl code again opens the file to obtain security descriptor. The client does not have the newly created file handle or inode in any of its lists yet so it does not respond to oplock break and server waits for its duration and then responds to the second open. This slows down file creation signficantly. The fix is to pass the file descriptor to the get cifsacl code wherever available so that get cifs acl code does not send second open (NT Create ANDX) and oplock is not broken. CC: Shirish Pargaonkar <shirishp@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix mtime on cp -p when file data cached but written out too lateSteve French2008-03-141-4/+5
| | | | | | | | | | | | | | Kukks noticed that cp -p can write out file data too late, after the timestamp is already set. This was introduced as an unintentional sideeffect of the change in an earlier patch (see below) which fixed some delayed return code propagation. cea218054ad277d6c126890213afde07b4eb1602 Author: Jeff Layton <jlayton@redhat.com> Date: Tue Nov 20 23:19:03 2007 +0000 Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix build problemSteve French2008-03-111-0/+4
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] cifs: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-03-103-15/+15
| | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] DFS patch that connects inode with dfs handling opsIgor Mammedov2008-03-091-62/+71
| | | | | | | if DFS junction point Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] remove unused variableSteve French2008-02-261-3/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] consolidate duplicate code in posix/unix inode handlingChristoph Hellwig2008-02-251-176/+103
| | | | | Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] fix build break when proc disabledSteve French2008-02-181-2/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6Steve French2008-02-154-19/+37
|\
| * Introduce path_put()Jan Blunck2008-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add path_put() functions for releasing a reference to the dentry and vfsmount of a struct path in the right order * Switch from path_release(nd) to path_put(&nd->path) * Rename dput_path() to path_put_conditional() [akpm@linux-foundation.org: fix cifs] Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: <linux-fsdevel@vger.kernel.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Steven French <sfrench@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| * Embed a struct path into struct nameidata instead of nd->{dentry,mnt}Jan Blunck2008-02-141-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the central patch of a cleanup series. In most cases there is no good reason why someone would want to use a dentry for itself. This series reflects that fact and embeds a struct path into nameidata. Together with the other patches of this series - it enforced the correct order of getting/releasing the reference count on <dentry,vfsmount> pairs - it prepares the VFS for stacking support since it is essential to have a struct path in every place where the stack can be traversed - it reduces the overall code size: without patch series: text data bss dec hex filename 5321639 858418 715768 6895825 6938d1 vmlinux with patch series: text data bss dec hex filename 5320026 858418 715768 6894212 693284 vmlinux This patch: Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix cifs] [akpm@linux-foundation.org: fix smack] Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| * iget: stop CIFS from using iget() and read_inode()David Howells2008-02-073-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop the CIFS filesystem from using iget() and read_inode(). Replace cifs_read_inode() with cifs_iget(), and call that instead of iget(). cifs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. cifs_read_super() now returns any error incurred when getting the root inode instead of ENOMEM. cifs_iget() needs examining. The comment "can not call macro FreeXid here since in a void func" is no longer true. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Steven French <sfrench@us.ibm.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | [CIFS] factoring out common code in get_inode_info functionsChristoph Hellwig2008-02-151-63/+43
| | | | | | | | | | Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] fix prepath conversion when server supports posix pathsSteve French2008-02-151-1/+7
| | | | | | | | | | | | | | | | Jeff Layton that we were converting \ to / in the posix path case which is not always right (depends on what the old delim was). CC: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Only convert / when server does not support posix pathsIgor Mammedov2008-02-151-2/+11
| | | | | | | | | | | | Also add warning if posix path setting changes on reconnect Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Fix mixed case name in structure dfs_info3_paramIgor Mammedov2008-02-152-2/+2
| | | | | | | | | | Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] fixup prefixpaths which contain multiple path componentsSteve French2008-02-142-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when we get a prefixpath as part of mount, the kernel only changes the first character to be a '/' or '\' depending on whether posix extensions are enabled. This is problematic as it expects mount.cifs to pass in the correct delimiter in the rest of the prefixpath. But, mount.cifs may not know *what* the correct delimiter is. It's a chicken and egg problem. Note that mount.cifs should not do conversion of the prefixpath - if we want posix behavior then '\' is legal in a path (and we have had bugs in the distant path to prove to me that customers sometimes have apps that require '\'). The kernel code assumes that the path passed in is posix (and current code will handle the first path component fine but was broken for Windows mounts for "deep" prefixpaths unless the user specified a prefixpath with '\' deep in it. So e.g. with current kernel code: 1) mount to //server/share/dir1 will work to all server types 2) mount to //server/share/dir1/subdir1 will work to Samba 3) mount to //server/share/dir1\\subdir1 will work to Windows But case two would fail to Windows without the fix. With the kernel cifs module fix case two now works. First analyzed by Jeff Layton and Simo Sorce CC: Jeff Layton <jlayton@redhat.com> CC: Simo Sorce <simo@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] fix typoSteve French2008-02-131-1/+1
| | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] patch to fix incorrect encoding of number of aces on set modeShirish Pargaonkar2008-02-121-5/+1
| | | | | | | | | | | | | | | | This patch fixes an error in the experimental cifs acl code. During chmod, set security descriptor data (num aces) is not sent with little-endian encoding. Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Fix typo in quota operationsRoel Kluin2008-02-121-1/+1
| | | | | | | | | | | | | | | | Although these experimental operations are not fully implemented, fix the typo in the definition of the quotactl operations for cifs. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] clean up some hard to read ifdefsSteve French2008-02-1213-84/+51
| | | | | | | | | | | | | | | | Christoph had noticed too many ifdefs in the CIFS code making it hard to read. This patch removes about a quarter of them from the C files in cifs by improving a few key ifdefs in the .h files. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] reduce checkpatch warningsSteve French2008-02-0723-279/+167
| | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* | Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6Steve French2008-02-061-1/+1
|\ \ | |/
| * Pagecache zeroing: zero_user_segment, zero_user_segments and zero_userChristoph Lameter2008-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify page cache zeroing of segments of pages through 3 functions zero_user_segments(page, start1, end1, start2, end2) Zeros two segments of the page. It takes the position where to start and end the zeroing which avoids length calculations and makes code clearer. zero_user_segment(page, start, end) Same for a single segment. zero_user(page, start, length) Length variant for the case where we know the length. We remove the zero_user_page macro. Issues: 1. Its a macro. Inline functions are preferable. 2. The KM_USER0 macro is only defined for HIGHMEM. Having to treat this special case everywhere makes the code needlessly complex. The parameter for zeroing is always KM_USER0 except in one single case that we open code. Avoiding KM_USER0 makes a lot of code not having to be dealing with the special casing for HIGHMEM anymore. Dealing with kmap is only necessary for HIGHMEM configurations. In those configurations we use KM_USER0 like we do for a series of other functions defined in highmem.h. Since KM_USER0 is depends on HIGHMEM the existing zero_user_page function could not be a macro. zero_user_* functions introduced here can be be inline because that constant is not used when these functions are called. Also extract the flushing of the caches to be outside of the kmap. [akpm@linux-foundation.org: fix nfs and ntfs build] [akpm@linux-foundation.org: fix ntfs build some more] Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Steven French <sfrench@us.ibm.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: <linux-ext4@vger.kernel.org> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Mark Fasheh <mark.fasheh@oracle.com> Cc: David Chinner <dgc@sgi.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: Steven French <sfrench@us.ibm.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | [CIFS] fix warning in cifs_spnego.cAndrew Morton2008-02-051-1/+1
|/ | | | | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] DFS build fixesSteve French2008-01-256-31/+61
| | | | | | Also includes a few minor changes suggested by Christoph Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] DFS support: provide shrinkable mountsIgor Mammedov2008-01-255-1/+387
| | | | | Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Do not log path names in lookup errorsSteve French2008-01-201-6/+4
| | | | | | | | | | Andi Kleen noticed that we were logging access denied errors (which is noisy in the dmesg log, and not needed to be logged) and that we were logging path names on that an other errors (e.g. EIO) which we should not be doing. CC: Andi Kleen <ak@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] DFS support patchset: Added mountdataIgor Mammedov2008-01-113-2/+41
| | | | | | | Also cifs_fs_type was made not static for ussage in dfs code. Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Forgot to add two new files from previous commitSteve French2008-01-102-0/+155
| | | | | | Thanks to Igor for noticing this. CC: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] DNS name resolution helper upcall for cifsSteve French2008-01-092-1/+16
| | | | | | | | | | | | Adds additional option CIFS_DFS_UPCALL to fs/Kconfig for enabling DFS support. Resolved IP address is saved as a string in the key payload. Igor has a series of related patches that will follow which finish up CIFS DFS support Acked-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] fix checkpatch warnings in fs/cifs/inode.cSteve French2008-01-083-25/+31
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] hold ses sem on tcp session reconnect during mountSteve French2008-01-031-3/+3
| | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Allow setting mode via cifs aclSteve French2007-12-316-13/+315
| | | | | | | Requires cifsacl mount flag to be on and CIFS_EXPERIMENTAL enabled CC: Shirish Pargaonkar <shirishp@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] fix unicode string alignment in SPNEGO setupJeff Layton2007-12-311-1/+1
| | | | | | | | | Unicode strings need to be word aligned, but the code that handles that is currently not taking the length of the SPNEGO blob into account. Fix it to do so. Signed-off-by: Jeff Layton <jlayton@tupile.poochiereds.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] cifs_partialpagewrite() cleanupSteve French2007-12-311-5/+3
| | | | | | | rc cannot be -EBADF now and condition is always true Signed-off-by: Vasily Averin <vvs@sw.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] use krb5 session key from first SMB session after a NegProtJeff Layton2007-12-311-3/+5
| | | | | | | | | Currently, any new kerberos SMB session overwrites the server's session key. The session key should only be set by the first SMB session set up on the socket. Signed-off-by: Jeff Layton <jlayton@tupile.poochiereds.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] redo existing session setup if needed in cifs_mountJeff Layton2007-12-312-2/+11
| | | | | | | | | | | | | | | | | | | | | | | When cifs_mount finds an existing SMB session that it can use for a new mount, it does not check to see whether that session is in need of being reconnected. An easy way to reproduce: 1) mount //server/share1 2) watch /proc/fs/cifs/DebugData for the share to go DISCONNECTED 3) mount //server/share2 with same creds as in step 1. The second mount will fail because CIFSTCon returned -EAGAIN. If you do an operation in share1 and then reattempt the mount it will work (since the session is reestablished). The following patch fixes this by having cifs_mount check the status of the session when it picks an existing session and calling cifs_setup_session on it again if it's in need of reconnection. Thanks to Wojciech Pilorz for the initial bug report. Signed-off-by: Jeff Layton <jlayton@tupile.poochiereds.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Only dump SPNEGO key if CONFIG_CIFS_DEBUG2 is setJeff Layton2007-12-311-2/+4
| | | | | | | | The SPNEGO key data is not terribly interesting except in certain debugging situations. Only dump it to the ring buffer if needed. Signed-off-by: Jeff Layton <jlayton@tupile.poochiereds.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] fix SetEA failure to some Samba versionsSteve French2007-12-302-2/+2
| | | | | | | Thanks to Oleg Gvozdev for noticing the problem. CC: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* regression: cifs endianness bugAl Viro2007-12-051-16/+17
| | | | | | | | | | | access_flags_to_mode() gets on-the-wire data (little-endian) and treats it as host-endian. Introduced in commit e01b64001359034d04c695388870936ed3d1b56b ("[CIFS] enable get mode from ACL when cifsacl mount option specified") Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [CIFS] Fix check after use error in ACL codeSteve French2007-11-251-6/+7
| | | | | | | Spotted by the coverity scanner. CC: Adrian Bunk <bunk@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix potential data corruption when writing out cached dirty pagesJeff Layton2007-11-205-30/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix RedHat bug 329431 The idea here is separate "conscious" from "unconscious" flushes. Conscious flushes are those due to a fsync() or close(). Unconscious ones are flushes that occur as a side effect of some other operation or due to memory pressure. Currently, when an error occurs during an unconscious flush (ENOSPC or EIO), we toss out the page and don't preserve that error to report to the user when a conscious flush occurs. If after the unconscious flush, there are no more dirty pages for the inode, the conscious flush will simply return success even though there were previous errors when writing out pages. This can lead to data corruption. The easiest way to reproduce this is to mount up a CIFS share that's very close to being full or where the user is very close to quota. mv a file to the share that's slightly larger than the quota allows. The writes will all succeed (since they go to pagecache). The mv will do a setattr to set the new file's attributes. This calls filemap_write_and_wait, which will return an error since all of the pages can't be written out. Then later, when the flush and release ops occur, there are no more dirty pages in pagecache for the file and those operations return 0. mv then assumes that the file was written out correctly and deletes the original. CIFS already has a write_behind_rc variable where it stores the results from earlier flushes, but that value is only reported in cifs_close. Since the VFS ignores the return value from the release operation, this isn't helpful. We should be reporting this error during the flush operation. This patch does the following: 1) changes cifs_fsync to use filemap_write_and_wait and cifs_flush and also sync to check its return code. If it returns successful, they then check the value of write_behind_rc to see if an earlier flush had reported any errors. If so, they return that error and clear write_behind_rc. 2) sets write_behind_rc in a few other places where pages are written out as a side effect of other operations and the code waits on them. 3) changes cifs_setattr to only call filemap_write_and_wait for ATTR_SIZE changes. 4) makes cifs_writepages accurately distinguish between EIO and ENOSPC errors when writing out pages. Some simple testing indicates that the patch works as expected and that it fixes the reproduceable known problem. Acked-by: Dave Kleikamp <shaggy@austin.rr.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix spurious reconnect on 2nd peek from read of SMB lengthPetr Tesarik2007-11-201-3/+3
| | | | | | | | | | | When retrying kernel_recvmsg() because of a short read, check returned length against the remaining length, not against total length. This avoids unneeded session reconnects which would otherwise occur when kernel_recvmsg() finally returns zero when asked to read zero bytes. Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] remove build warningSteve French2007-11-173-2/+2
| | | | | CC: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Have CIFS_SessSetup build correct SPNEGO SessionSetup requestSteve French2007-11-164-18/+77
| | | | | | | | | | | | | | | Have CIFS_SessSetup call cifs_get_spnego_key when Kerberos is negotiated. Use the info in the key payload to build a session setup request packet. Also clean up how the request buffer in the function is freed on error. With appropriate user space helper (in samba/source/client). Kerberos support (secure session establishment can be done now via Kerberos, previously users would have to use NTLMv2 instead for more secure session setup). Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] minor checkpatch cleanupSteve French2007-11-163-9/+9
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
OpenPOWER on IntegriCloud