aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27[CIFS] Update CIFS version number to 1.77Steve French1-1/+1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-27CIFS: Add missed forcemand mount optionPavel Shilovsky1-2/+5
The 'forcemand' form of 'forcemandatorylock' mount option was missed when the code moved to use the standard token parser. Return it back. Also fix a comment style in the parser. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-23[CIFS] Fix trivial sparse warning with asyn i/o patchSteve French1-1/+1
Signed-off-by: Steve French <sfrench@us.ibm.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
2012-03-23cifs: handle "sloppy" option appropriatelyJeff Layton1-3/+18
cifs.ko has historically been tolerant of options that it does not recognize. This is not normal behavior for a filesystem however. Usually, it should only do this if you mount with '-s', and autofs generally passes -s to the mount command to allow this behavior. This patch makes cifs handle the option "sloppy" appropriately. If it's present in the options string, then the client will tolerate options that it doesn't recognize. If it's not present then the client will error out in the presence of options that it does not recognize and throw an error message explaining why. There is also a companion patch being proposed for mount.cifs to make it append "sloppy" to the mount options when passed the '-s' flag. This also should (obviously) be applied on top of Sachin's conversion to the standard option parser. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-By: Sachin Prabhu <sprabhu@redhat.com>
2012-03-23cifs: use standard token parser for mount optionsSachin Prabhu1-524/+814
Use the standard token parser instead of the long if condition to parse cifs mount options. This was first proposed by Scott Lovenberg http://lists.samba.org/archive/linux-cifs-client/2010-May/006079.html Mount options have been grouped together in terms of their input types. Aliases for username, password, domain and credentials have been added. The password parser has been modified to make it easier to read. Since the patch was first proposed, the following bugs have been fixed 1) Allow blank 'pass' option to be passed by the cifs mount helper when using sec=none. 2) Do not explicitly set vol->nullauth to 0. This causes a problem when using sec=none while also using a username. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
2012-03-23cifs: remove /proc/fs/cifs/OplockEnabledJeff Layton1-43/+0
We've had a deprecation warning on this file for 2 releases now. Remove it as promised for 3.4. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2012-03-23cifs: convert cifs_iovec_write to use async writesJeff Layton3-86/+143
Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: call cifs_update_eof with i_lock heldJeff Layton3-2/+11
cifs_update_eof has the potential to be racy if multiple threads are trying to modify it at the same time. Protect modifications of the server_eof value with the inode->i_lock. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2012-03-23cifs: abstract out function to marshal up the iovec array for async writesJeff Layton3-10/+31
We'll need to do something a bit different depending on the caller. Abstract the code that marshals the page array into an iovec. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: fix up get_numpagesJeff Layton1-3/+1
Use DIV_ROUND_UP. Also, PAGE_SIZE is more appropriate here since these aren't pagecache pages. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: make cifsFileInfo_get return the cifsFileInfo pointerJeff Layton1-1/+3
Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: fix allocation in cifs_write_allocate_pagesJeff Layton1-7/+6
The gfp flags are currently set to __GPF_HIGHMEM, which doesn't allow for any reclaim. Make this more resilient by or'ing that with GFP_KERNEL. Also, get rid of the goto and unify the exit codepath. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: allow caller to specify completion op when allocating writedataJeff Layton3-5/+8
We'll need a different set of write completion ops when not writing out of the pagecache. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: add pid field to cifs_writedataJeff Layton3-2/+4
We'll need this to handle rwpidforward option correctly when we use async writes in the aio_write op. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23cifs: add new cifsiod_wq workqueueJeff Layton5-8/+20
...and convert existing cifs users of system_nrt_wq to use that instead. Also, make it freezable, and set WQ_MEM_RECLAIM since we use it to deal with write reply handling. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
2012-03-23CIFS: Change mid_q_entry structure fieldsPavel Shilovsky6-59/+59
to be protocol-unspecific and big enough to keep both CIFS and SMB2 values. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23CIFS: Expand CurrentMid fieldPavel Shilovsky3-40/+48
While in CIFS/SMB we have 16 bit mid, in SMB2 it is 64 bit. Convert the existing field to 64 bit and mask off higher bits for CIFS/SMB. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23CIFS: Separate protocol-specific code from cifs_readv_receive codePavel Shilovsky5-34/+53
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23CIFS: Separate protocol-specific code from demultiplex codePavel Shilovsky7-47/+56
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23CIFS: Separate protocol-specific code from transport routinesPavel Shilovsky6-88/+119
that lets us use this functions for SMB2. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
2012-03-23Merge git://git.samba.org/sfrench/cifs-2.6Linus Torvalds11-109/+169
Pull CIFS fixes from Steve French * git://git.samba.org/sfrench/cifs-2.6: cifs: clean up ordering in exit_cifs cifs: clean up call to cifs_dfs_release_automount_timer() CIFS: Delete echo_retries module parm CIFS: Prepare credits code for a slot reservation CIFS: Make wait_for_free_request killable CIFS: Introduce credit-based flow control CIFS: Simplify inFlight logic cifs: fix issue mounting of DFS ROOT when redirecting from one domain controller to the next CIFS: Respect negotiated MaxMpxCount CIFS: Fix a spurious error in cifs_push_posix_locks
2012-03-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds1-6/+1
Pull vfs pile 1 from Al Viro: "This is _not_ all; in particular, Miklos' and Jan's stuff is not there yet." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits) ext4: initialization of ext4_li_mtx needs to be done earlier debugfs-related mode_t whack-a-mole hfsplus: add an ioctl to bless files hfsplus: change finder_info to u32 hfsplus: initialise userflags qnx4: new helper - try_extent() qnx4: get rid of qnx4_bread/qnx4_getblk take removal of PF_FORKNOEXEC to flush_old_exec() trim includes in inode.c um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it um: embed ->stub_pages[] into mmu_context gadgetfs: list_for_each_safe() misuse ocfs2: fix leaks on failure exits in module_init ecryptfs: make register_filesystem() the last potential failure exit ntfs: forgets to unregister sysctls on register_filesystem() failure logfs: missing cleanup on register_filesystem() failure jfs: mising cleanup on register_filesystem() failure make configfs_pin_fs() return root dentry on success configfs: configfs_create_dir() has parent dentry in dentry->d_parent configfs: sanitize configfs_create() ...
2012-03-21Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-securityLinus Torvalds1-0/+1
Pull security subsystem updates for 3.4 from James Morris: "The main addition here is the new Yama security module from Kees Cook, which was discussed at the Linux Security Summit last year. Its purpose is to collect miscellaneous DAC security enhancements in one place. This also marks a departure in policy for LSM modules, which were previously limited to being standalone access control systems. Chromium OS is using Yama, and I believe there are plans for Ubuntu, at least. This patchset also includes maintenance updates for AppArmor, TOMOYO and others." Fix trivial conflict in <net/sock.h> due to the jumo_label->static_key rename. * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (38 commits) AppArmor: Fix location of const qualifier on generated string tables TOMOYO: Return error if fails to delete a domain AppArmor: add const qualifiers to string arrays AppArmor: Add ability to load extended policy TOMOYO: Return appropriate value to poll(). AppArmor: Move path failure information into aa_get_name and rename AppArmor: Update dfa matching routines. AppArmor: Minor cleanup of d_namespace_path to consolidate error handling AppArmor: Retrieve the dentry_path for error reporting when path lookup fails AppArmor: Add const qualifiers to generated string tables AppArmor: Fix oops in policy unpack auditing AppArmor: Fix error returned when a path lookup is disconnected KEYS: testing wrong bit for KEY_FLAG_REVOKED TOMOYO: Fix mount flags checking order. security: fix ima kconfig warning AppArmor: Fix the error case for chroot relative path name lookup AppArmor: fix mapping of META_READ to audit and quiet flags AppArmor: Fix underflow in xindex calculation AppArmor: Fix dropping of allowed operations that are force audited AppArmor: Add mising end of structure test to caps unpacking ...
2012-03-21cifs: clean up ordering in exit_cifsJeff Layton1-5/+5
...ensure that we undo things in the reverse order from the way they were done. In truth, the ordering doesn't matter for a lot of these, but it's still better to do it that way to be sure. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21cifs: clean up call to cifs_dfs_release_automount_timer()Jeff Layton2-2/+6
Take the #ifdef junk out of the code, and turn it into a noop macro when CONFIG_CIFS_DFS_UPCALL isn't defined. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21CIFS: Delete echo_retries module parmPavel Shilovsky4-17/+15
It's the essential step before respecting MaxMpxCount value during negotiating because we will keep only one extra slot for sending echo requests. If there is no response during two echo intervals - reconnect the tcp session. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21CIFS: Prepare credits code for a slot reservationPavel Shilovsky2-10/+26
that is essential for CIFS/SMB/SMB2 oplock breaks and SMB2 echos. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21CIFS: Make wait_for_free_request killablePavel Shilovsky1-1/+6
to let us kill the proccess if it hangs waiting for a credit when the session is down and echo is disabled. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21CIFS: Introduce credit-based flow controlPavel Shilovsky6-44/+60
and send no more than credits value requests at once. For SMB/CIFS it's trivial: increment this value by receiving any message and decrement by sending one. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21CIFS: Simplify inFlight logicPavel Shilovsky5-33/+52
by making it as unsigned integer and surround access with req_lock from server structure. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-21cifs: fix issue mounting of DFS ROOT when redirecting from one domain controller to the nextJeff Layton1-1/+2
This patch fixes an issue when cifs_mount receives a STATUS_BAD_NETWORK_NAME error during cifs_get_tcon but is able to continue after an DFS ROOT referral. In this case, the return code variable is not reset prior to trying to mount from the system referred to. Thus, is_path_accessible is not executed and the final DFS referral is not performed causing a mount error. Use case: In DNS, example.com resolves to the secondary AD server ad2.example.com Our primary domain controller is ad1.example.com and has a DFS redirection set up from \\ad1\share\Users to \\files\share\Users. Mounting \\example.com\share\Users fails. Regression introduced by commit 724d9f1. Cc: stable@vger.kernel.org Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru Signed-off-by: Thomas Hadig <thomas@intapp.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-20switch open-coded instances of d_make_root() to new helperAl Viro1-3/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-03-20clean up the failure exits in cifs_read_super()Al Viro1-4/+1
no need to make that iput() conditional, just take it to the right place... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-03-20CIFS: Respect negotiated MaxMpxCountPavel Shilovsky7-26/+26
Some servers sets this value less than 50 that was hardcoded and we lost the connection if when we exceed this limit. Fix this by respecting this value - not sending more than the server allows. Cc: stable@kernel.org Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <stevef@smf-gateway.(none)>
2012-03-19CIFS: Fix a spurious error in cifs_push_posix_locksPavel Shilovsky1-9/+10
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@redhat.com> Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Steve French <stevef@smf-gateway.(none)>
2012-03-06CIFS: Do not kmalloc under the flocks spinlockPavel Shilovsky1-13/+56
Reorganize the code to make the memory already allocated before spinlock'ed loop. Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-03-06cifs: possible memory leak in xattr.Santosh Nayak1-3/+3
Memory is allocated irrespective of whether CIFS_ACL is configured or not. But free is happenning only if CIFS_ACL is set. This is a possible memory leak scenario. Fix is: Allocate and free memory only if CIFS_ACL is configured. Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com> Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-02-26cifs: fix dentry refcount leak when opening a FIFO on lookupJeff Layton1-2/+18
The cifs code will attempt to open files on lookup under certain circumstances. What happens though if we find that the file we opened was actually a FIFO or other special file? Currently, the open filehandle just ends up being leaked leading to a dentry refcount mismatch and oops on umount. Fix this by having the code close the filehandle on the server if it turns out not to be a regular file. While we're at it, change this spaghetti if statement into a switch too. Cc: stable@vger.kernel.org Reported-by: CAI Qian <caiqian@redhat.com> Tested-by: CAI Qian <caiqian@redhat.com> Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-02-26CIFS: Fix mkdir/rmdir bug for the non-POSIX casePavel Shilovsky1-9/+19
Currently we do inc/drop_nlink for a parent directory for every mkdir/rmdir calls. That's wrong when Unix extensions are disabled because in this case a server doesn't follow the same semantic and returns the old value on the next QueryInfo request. As the result, we update our value with the server one and then decrement it on every rmdir call - go to negative nlink values. Fix this by removing inc/drop_nlink for the parent directory from mkdir/rmdir, setting it for a revalidation and ignoring NumberOfLinks for directories when Unix extensions are disabled. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
2012-02-09Merge branch 'next-queue' into nextJames Morris1-0/+1
2012-02-07cifs: don't return error from standard_receive3 after marking response malformedJeff Layton1-3/+4
standard_receive3 will check the validity of the response from the server (via checkSMB). It'll pass the result of that check to handle_mid which will dequeue it and mark it with a status of MID_RESPONSE_MALFORMED if checkSMB returned an error. At that point, standard_receive3 will also return an error, which will make the demultiplex thread skip doing the callback for the mid. This is wrong -- if we were able to identify the request and the response is marked malformed, then we want the demultiplex thread to do the callback. Fix this by making standard_receive3 return 0 in this situation. Cc: stable@vger.kernel.org Reported-and-Tested-by: Mark Moseley <moseleymark@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-02-07cifs: request oplock when doing open on lookupJeff Layton1-1/+1
Currently, it's always set to 0 (no oplock requested). Cc: <stable@vger.kernel.org> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-02-07cifs: fix error handling when cifscreds key payload is an errorJeff Layton1-1/+1
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-02-02cifs: Fix oops in session setup code for null user mountsShirish Pargaonkar1-4/+3
For null user mounts, do not invoke string length function during session setup. Cc: <stable@kernel.org Reported-and-Tested-by: Chris Clayton <chris2553@googlemail.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-01-31[CIFS] Update cifs Kconfig title to match removal of experimental dependencySteve French1-2/+2
Removed the dependency on CONFIG_EXPERIMENTAL but forgot to update the text description to be consistent. Signed-off-by: Steve French <smfrench@gmail.com>
2012-01-31cifs: fix printk format warningsRandy Dunlap1-4/+4
Fix printk format warnings for ssize_t variables: fs/cifs/connect.c:2145:3: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t' fs/cifs/connect.c:2152:3: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t' fs/cifs/connect.c:2160:3: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t' fs/cifs/connect.c:2170:3: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Jeff Layton <jlayton@redhat.com> Cc: linux-cifs@vger.kernel.org
2012-01-31cifs: check offset in decode_ntlmssp_challenge()Dan Carpenter1-0/+4
We should check that we're not copying memory from beyond the end of the blob. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
2012-01-24cifs: NULL dereference on allocation failureDan Carpenter1-4/+2
We should just return directly here, the goto causes a NULL dereference. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
2012-01-18CIFS: Rename *UCS* functions to *UTF16*Steve French8-138/+146
to reflect the unicode encoding used by CIFS protocol. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Acked-by: Jeff Layton <jlayton@samba.org> Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
2012-01-19KEYS: Allow special keyrings to be clearedDavid Howells1-0/+1
The kernel contains some special internal keyrings, for instance the DNS resolver keyring : 2a93faf1 I----- 1 perm 1f030000 0 0 keyring .dns_resolver: empty It would occasionally be useful to allow the contents of such keyrings to be flushed by root (cache invalidation). Allow a flag to be set on a keyring to mark that someone possessing the sysadmin capability can clear the keyring, even without normal write access to the keyring. Set this flag on the special keyrings created by the DNS resolver, the NFS identity mapper and the CIFS identity mapper. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Jeff Layton <jlayton@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>