summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
Commit message (Collapse)AuthorAgeFilesLines
* [CIFS] Fix hang in find_writable_fileSteve French2007-07-261-10/+23
| | | | | | | | | | | | Caused by unneeded reopen during reconnect while spinlock held. Fixes kernel bugzilla bug #7903 Thanks to Lin Feng Shen for testing this, and Amit Arora for some nice problem determination to narrow this down. Acked-by: Dave Kleikamp <shaggy@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Allow disabling CIFS Unix Extensions as mount optionSteve French2007-07-181-3/+3
| | | | | | | | | Previously the only way to do this was to umount all mounts to that server, turn off a proc setting (/proc/fs/cifs/LinuxExtensionsEnabled). Fixes Samba bugzilla bug number: 4582 (and also 2008) Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] More whitespace/formatting fixes (noticed by checkpatch)Steve French2007-07-171-2/+3
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] use simple_prepare_write to zero page dataNate2007-07-161-8/+1
| | | | | | | | | | | It's common for file systems to need to zero data on either side of a write, if a page is not Uptodate during prepare_write. It just so happens that simple_prepare_write() in libfs.c does exactly that, so we can avoid duplication and just call that function to zero page data. Signed-off-by: Nate Diller <nate.diller@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] whitespace/formatting fixesSteve French2007-07-131-10/+11
| | | | | | | | | This should be the last big batch of whitespace/formatting fixes. checkpatch warnings for the cifs directory are down about 90% and many of the remaining ones are harder to remove or make the code harder to read. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix oops in cifs_create when nfsd server exports cifs mountSteve French2007-07-111-1/+1
| | | | | | | | | | | nfsd is passing null nameidata (probably the only one doing that) on call to create - cifs was missing one check for this. Note that running nfsd over a cifs mount requires specifying fsid on the nfs exports entry and requires mounting cifs with serverino mount option. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] whitespace cleanupSteve French2007-07-101-120/+125
| | | | | | More than halfway there Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Add in some missing flags and cifs README and TODO correctionsSteve French2007-06-241-2/+7
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* header cleaning: don't include smp_lock.h when not usedRandy Dunlap2007-05-081-1/+0
| | | | | | | | | | | | Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [CIFS] Change semaphore to mutex for cifs lock_semRoland Dreier2007-05-031-7/+7
| | | | | | | | | | | | | | | Originally at http://lkml.org/lkml/2006/9/2/86 The recent change to "allow Windows blocking locks to be cancelled via a CANCEL_LOCK call" introduced a new semaphore in struct cifsFileInfo, lock_sem. However, semaphores used as mutexes are deprecated these days, and there's no reason to add a new one to the kernel. Therefore, convert lock_sem to a struct mutex (and also fix one indentation glitch on one of the lines changed anyway). Signed-off-by: Roland Dreier <roland@digitalvampire.org> Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Remove unnecessary parm to cifs_reopen_fileSteve French2007-04-041-60/+26
| | | | | | | | Also expand debug entry to show which character on a failed Unicode mapping. Acked-by: Shaggy <shaggy@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Remove unnecessary checksChristoph Hellwig2007-04-021-27/+2
| | | | | | | | | file->f_path.dentry or file->f_path.dentry.d_inode can't be NULL since at least ten years, similar for all but very few arguments passed in from the VFS. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] cifs_prepare_write was incorrectly rereading page in some casesSteve French2007-03-061-22/+40
| | | | | | | Noticed by Shaggy. Signed-off-by: Shaggy <shaggy@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix locking problem around some cifs uses of i_size writeSteve French2007-02-261-20/+23
| | | | | | | | | | | | | | | Could cause hangs on smp systems in i_size_read on a cifs inode whose size has been previously simultaneously updated from different processes. Thanks to Brian Wang for some great testing/debugging on this hard problem. Fixes kernel bugzilla #7903 CC: Shirish Pargoankar <shirishp@us.ibm.com> CC: Shaggy <shaggy@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] One line missing from previous commitSteve French2007-02-171-2/+3
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Allow update of EOF on remote extend of fileSteve French2007-02-081-1/+4
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Reduce cifs stack space usageSteve French2007-02-021-3/+9
| | | | | | | | | | | The two cifs functions that used the most stack according to "make checkstack" have been changed to use less stack. Thanks to jra and Shaggy for helpful ideas Signed-off-by: Steve French <sfrench@us.ibm.com> cc: jra@samba.org cc: shaggy@us.ibm.com
* Fix up CIFS for "test_clear_page_dirty()" removalLinus Torvalds2006-12-231-3/+23
| | | | | | | | | This also adds he required page "writeback" flag handling, that cifs hasn't been doing and that the page dirty flag changes made obvious. Acked-by: Steve French <smfltc@us.ibm.com> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] io-accounting-read-accounting cifs fixAndrew Morton2006-12-101-0/+2
| | | | | | | | | | | | | | | | CIFS implements ->readpages and doesn't use read_cache_pages(). So wire the read IO accounting up within CIFS. Cc: Jay Lan <jlan@sgi.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Chris Sturtivant <csturtiv@sgi.com> Cc: Tony Ernst <tee@sgi.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: Steven French <sfrench@us.ibm.com> Cc: David Wright <daw@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] cifs: change uses of f_{dentry, vfsmnt} to use f_pathJosef "Jeff" Sipek2006-12-081-57/+57
| | | | | | | | | Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the cifs filesystem. Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [CIFS] Fix minor problem with previous patchSteve French2006-11-091-1/+2
| | | | | | | | | The patch NFS stress test generates flood of "close with pending write was missing an if Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] NFS stress test generates flood of "close with pending write" messagesSteve French2006-11-071-2/+5
| | | | | | | | Informational/debug message was being logged too often. The error case of logging having to send a close with (presumably stuck on buggy server) pending writes is still logged. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [PATCH] cifs: ->readpages() fixesOGAWA Hirofumi2006-11-031-22/+1
| | | | | | | | | | | | This just ignore the remaining pages, and will fix a forgot put_pages_list(). Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Steven French <sfrench@us.ibm.com> Cc: Miklos Szeredi <miklos@szeredi.hu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] BLOCK: Remove no-longer necessary linux/mpage.h inclusions [try #6]David Howells2006-09-301-1/+0
| | | | | | | | Remove inclusions of linux/mpage.h that are no longer necessary due to the transfer of generic_writepages(). Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
* [CIFS] New POSIX locking code not setting rc properly to zero on successfulSteve French2006-09-211-1/+2
| | | | | | | unlock in case where server does not support POSIX locks and nobrl is not specified. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS]Jeremy Allison2006-08-111-15/+80
| | | | | | | | | | | Allow Windows blocking locks to be cancelled via a CANCEL_LOCK call. TODO - restrict this to servers that support NT_STATUS codes (Win9x will probably not support this call). Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com> (cherry picked from 570d4d2d895569825d0d017d4e76b51138f68864 commit)
* [CIFS] Do not time out posix brl requests when using new posix setfileinfoSteve French2006-08-111-4/+2
| | | | | | | | | | request and do not time out slow requests to a server that is still responding well to other threads Suggested by jra of Samba team Signed-off-by: Steve French <sfrench@us.ibm.com> (cherry picked from 89b57148115479eef074b8d3f86c4c86c96ac969 commit)
* typo fixes: aquire -> acquireAdrian Bunk2006-06-301-1/+1
| | | | | Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* [PATCH] mark address_space_operations constChristoph Hellwig2006-06-281-2/+2
| | | | | | | | | | Same as with already do with the file operations: keep them in .rodata and prevents people from doing runtime patching. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Steven French <sfrench@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [CIFS] Remove calls to to take f_owner.lockIngo Molnar2006-06-261-9/+0
| | | | | | | | CIFS takes/releases f_owner.lock - why? It does not change anything in the fowner state. Remove this locking. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitSteve French2006-06-251-14/+12
|\
| * [PATCH] vfs: add lock owner argument to flush operationMiklos Szeredi2006-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass the POSIX lock owner ID to the flush operation. This is useful for filesystems which don't want to store any locking state in inode->i_flock but want to handle locking/unlocking POSIX locks internally. FUSE is one such filesystem but I think it possible that some network filesystems would need this also. Also add a flag to indicate that a POSIX locking request was generated by close(), so filesystems using the above feature won't send an extra locking request in this case. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| * [PATCH] writeback: fix range handlingOGAWA Hirofumi2006-06-231-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a writeback_control's `start' and `end' fields are used to indicate a one-byte-range starting at file offset zero, the required values of .start=0,.end=0 mean that the ->writepages() implementation has no way of telling that it is being asked to perform a range request. Because we're currently overloading (start == 0 && end == 0) to mean "this is not a write-a-range request". To make all this sane, the patch changes range of writeback_control. So caller does: If it is calling ->writepages() to write pages, it sets range (range_start/end or range_cyclic) always. And if range_cyclic is true, ->writepages() thinks the range is cyclic, otherwise it just uses range_start and range_end. This patch does, - Add LLONG_MAX, LLONG_MIN, ULLONG_MAX to include/linux/kernel.h -1 is usually ok for range_end (type is long long). But, if someone did, range_end += val; range_end is "val - 1" u64val = range_end >> bits; u64val is "~(0ULL)" or something, they are wrong. So, this adds LLONG_MAX to avoid nasty things, and uses LLONG_MAX for range_end. - All callers of ->writepages() sets range_start/end or range_cyclic. - Fix updates of ->writeback_index. It seems already bit strange. If it starts at 0 and ended by check of nr_to_write, this last index may reduce chance to scan end of file. So, this updates ->writeback_index only if range_cyclic is true or whole-file is scanned. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Nathan Scott <nathans@sgi.com> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Steven French <sfrench@us.ibm.com> Cc: "Vladimir V. Saveliev" <vs@namesys.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [CIFS] Add support for readdir to legacy serversSteve French2006-06-071-2/+7
| | | | | | | | | | | | | | Fixes oops to OS/2 on ls and removes redundant NTCreateX calls to servers which do not support NT SMBs. Key operations to OS/2 work. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Do not overwrite aopsDave Kleikamp2006-06-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | cifs should not be overwriting an element of the aops structure, since the structure is shared by all cifs inodes. Instead define a separate aops structure to suit each purpose. I also took the liberty of replacing a hard-coded 4096 with PAGE_CACHE_SIZE Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steven French <sfrench@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
* | [CIFS] Cleanup extra whitespace in dmesg logging. Update cifs change logSteve French2006-05-311-9/+9
|/
* [[CIFS] Pass truncate open flag through on file open in case setattr failsSteve French2006-05-301-0/+2
| | | | | | | on set size to zero. Signed-off-by: Sebastian Voitzsch <sebastoam/vpotzscj@web.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix typos in previous fixSteve French2006-05-301-2/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] ACPI suspend oopsSteve French2006-05-301-2/+4
| | | | | | | | | | | | | Wasn't able to reproduce a hard hang, but was able to get an oops if suspended the machine during a copy to the cifs mount. This led to some things hanging, including a "sync". Also got I/O errors when trying to access the mount afterwards (even when didn't see the oops), and had to unmount and remount in order to access the filesystem. This patch fixed the oops. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Fix new POSIX Locking for setting lock_type correctly on unlockSteve French2006-05-301-2/+2
| | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] Readdir fixes to allow search to start at arbitrary positionSteve French2006-04-221-12/+20
| | | | | | | | | in directory Also includes first part of fix to compensate for servers which forget to return . and .. as well as updates to changelog and cifs readme. Signed-off-by: Steve French <sfrench@us.ibm.com>
* [CIFS] [CIFS] Do not take rename sem on most path based calls (duringSteve French2006-04-211-2/+0
| | | | | | | | building of full path) to avoid hang rename/readdir hang Reported by Alan Tyson Signed-off-by: Steve French <sfrench@us.ibm.com>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitSteve French2006-03-311-4/+6
|\ | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * [PATCH] Make address_space_operations->sync_page return voidNeilBrown2006-03-261-2/+4
| | | | | | | | | | | | | | | | | | The only user ignores the return value, and the only instanace (block_sync_page) always returns 0... Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| * [PATCH] sem2mutex: vfs_rename_mutexArjan van de Ven2006-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Al Viro <viro@ftp.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [CIFS] Set correct lock type on new posix unlock callSteve French2006-03-031-1/+1
| | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Make POSIX CIFS Extensions SetFSInfo match exactly what we wantSteve French2006-03-021-2/+6
| | | | | | | | | | | | not just the posix path feature. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] Add posix (advisory) byte range locking support to cifs clientSteve French2006-02-281-19/+48
| | | | | | | | | | | | | | | | Samba (version 3) server support for this is also currently being done. This client code is in an experimental path (requires enabling /proc/fs/cifs/Experimental) while it is being tested. Signed-off-by: Steve French <sfrench@us.ibm.com>
* | [CIFS] CIFS readdir perf optimizations part 1Steve French2006-02-281-9/+14
|/ | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
* [PATCH] CIFS: fix cifs_user_read oops when null SMB response on ↵Steve French2006-02-141-6/+8
| | | | | | | | | | | forcedirectio mount This patch fixes an oops reported by Adrian Bunk in cifs_user_read when a null read response is returned on a forcedirectio mount. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>