1
0
Fork 0
Commit Graph

518 Commits (b0b933c08bd5fd053bbba8ba6387f543be03d49f)

Author SHA1 Message Date
Jeff Layton 8426c39c12 [CIFS] Make sec=none force an anonymous mount
We had a customer report that attempting to make CIFS mount with a null
username (i.e. doing an anonymous mount) doesn't work. Looking through the
code, it looks like CIFS expects a NULL username from userspace in order
to trigger an anonymous mount. The mount.cifs code doesn't seem to ever
pass a null username to the kernel, however.

It looks also like the kernel can take a sec=none option, but it only seems
to look at it if the username is already NULL. This seems redundant and
effectively makes sec=none useless.

The following patch makes sec=none force an anonymous mount.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-05-05 03:27:49 +00:00
Roland Dreier 796e5661f6 [CIFS] Change semaphore to mutex for cifs lock_sem
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>
2007-05-03 04:33:45 +00:00
Steve French 0b2365f826 [CIFS] Fix oops in reset_cifs_unix_caps on reconnect
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-05-03 04:30:13 +00:00
Steve French 4523cc3044 [CIFS] UID/GID override on CIFS mounts to Samba
When CIFS Unix Extensions are negotiated we get the Unix uid and gid
owners of the file from the server (on the Unix Query Path Info
levels), but if the server's uids don't match the client uid's users
were having to disable the Unix Extensions (which turned off features
they still wanted).   The changeset patch allows users to override uid
and/or gid for file/directory owner with a default uid and/or gid
specified at mount (as is often done when mounting from Linux cifs
client to Windows server).  This changeset also displays the uid
and gid used by default in /proc/mounts (if applicable).

Also cleans up code by adding some of the missing spaces after
"if" keywords per-kernel style guidelines (as suggested by Randy Dunlap
when he reviewed the patch).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-30 20:13:06 +00:00
Steve French 984acfe1cf [CIFS] prefixpath mounts to servers supporting posix paths used wrong slash
Acked-by: Alexander Bokovoy <abokovoy@ru.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-26 16:42:50 +00:00
Steve French deb0420c6f [CIFS] Update cifs version to 1.49
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-26 14:35:54 +00:00
vignesh eaa33a9ac0 [CIFS] Replace kmalloc/memset combination with kzalloc
Signed-off-by: Vignesh Babu <vignesh.babu@wipro.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-25 12:13:48 +00:00
Steve French 5858ae44e2 [CIFS] Add IPv6 support
IPv6 support was started a few years ago in the cifs client, but lacked a
kernel helper function for parsing the ascii form of the ipv6 address. Now
that that is added (and now IPv6 is the default that some OS use now) it
was fairly easy to finish  the cifs ipv6 support.  This  requires that
CIFS_EXPERIMENTAL be enabled and (at least until the mount.cifs module is
modified to use a new ipv6 friendly call instead of gethostbyname) and the
ipv6 address be passed on the mount as "ip=" mount option.

Thanks

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-25 11:59:10 +00:00
Steve French cbac3cba66 [CIFS] New CIFS POSIX mkdir performance improvement (part 2)
Fix incorrect parsing of return data

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-25 11:46:06 +00:00
Steve French 2dd29d3133 [CIFS] New CIFS POSIX mkdir performance improvement
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-23 22:07:35 +00:00
Steve French 5268df2ead [CIFS] Add write perm for usr to file on windows should remove r/o dos attr
Remove read only dos attribute on chmod when adding any write permission (ie on any of
user/group/other (not all of user/group/other ie  0222) when
mounted to windows.

Suggested by: Urs Fleisch

Signed-off-by: Urs Fleisch <urs.fleisch@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-06 19:28:16 +00:00
Steve French 3a9f462f6d [CIFS] Remove unnecessary parm to cifs_reopen_file
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>
2007-04-04 17:10:24 +00:00
Igor Mammedov aaf737adb6 [CIFS] Switch cifsd to kthread_run from kernel_thread
cifsd was the only cifs thread that had not been switched to the newer
kthread interface

Signed-off-by: Igor Mammedov <niallain at gmail.com>
Signed-off-by: Wilhelm Meier <wilhelm.meier@fh-kl.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-04-03 19:16:43 +00:00
Christoph Hellwig c33f8d3274 [CIFS] Remove unnecessary checks
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>
2007-04-02 18:47:20 +00:00
Linus Torvalds 12998096cc 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] Allow reset of file to ATTR_NORMAL when archive bit not set
  [CIFS] Do not negotiate new POSIX_PATH_OPERATIONS_CAP yet
  [CIFS] reset mode when client notices that ATTR_READONLY is no longer set
2007-03-22 19:47:09 -07:00
Steve French 066fcb06d3 [CIFS] Allow reset of file to ATTR_NORMAL when archive bit not set
When a file had a dos attribute of 0x1 (readonly - but dos attribute
of archive was not set) - doing chmod 0777 or equivalent would
try to set a dos attribute of 0 (which some servers ignore)
rather than ATTR_NORMAL (0x20) which most servers accept.
Does not affect servers which support the CIFS Unix Extensions.

Acked-by: Prasad Potluri <pvp@us.ibm.com>
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-03-23 00:45:08 +00:00
Steve French 38e2aff670 [CIFS] Do not negotiate new POSIX_PATH_OPERATIONS_CAP yet
Samba server now expects that clients which send the new
POSIX_PATH_OPERATIONS_CAP send all opens with this new
SMB - and expects that clients that could send the new
posix open/create but don't as indicating that they really
want Windows semantics on that handle (which allows Samba
to support clients which want to support both types of
behaviors on different handles on the same mount)

We will put this capability back in the SetFSInfo
negotiation with servers like Samba when the
new POSIXCreate (create/open/mkdir) code is finished.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-03-16 05:12:53 +00:00
Al Viro 82c05a13c9 [PATCH] cifs endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-14 15:27:50 -07:00
Alan Tyson f5c1e2ea71 [CIFS] reset mode when client notices that ATTR_READONLY is no longer set
Signed-off-by: Alan Tyso <atyson@hp.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-03-10 06:05:14 +00:00
Steve French 8a236264f7 [CIFS] cifs_prepare_write was incorrectly rereading page in some cases
Noticed by Shaggy.

Signed-off-by: Shaggy <shaggy@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-03-06 00:31:00 +00:00
Steve French c7af1857ef [CIFS] Fix set file size to zero when doing chmod to Samba 3.0.26pre
In fixing a bug Samba 3.0.26pre allowed some clients (including Linux cifs
client) to change file size to zero in SET_FILE_UNIX_BASIC (which Linux cifs
client uses for chmod).

The server has been "fixed" now but that also fixes the client to net send
file size zero on chmod.

Fixes Samba bugzilla bug # 4418.

Fixed with help from Jeremy Allison

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-03-01 04:11:22 +00:00
Steve French 99ee4dbd7c [CIFS] Remove some unused functions/declarations
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-27 05:35:17 +00:00
Steve French 1ae1bc44d4 [CIFS] New file for previous commit
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-27 05:16:30 +00:00
Steve French 35c11fdda7 [CIFS] cifs export operations
For nfsd to work over cifs mounts (which presumably makes sense when trying
to reexport mounts to windows, network appliances or Samba servers to nfs
clients via nfs server).

This is the first stage of that enablement, marked experimental and turned
off by default.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-27 05:09:35 +00:00
Steve French ba6a46a03f [CIFS] small piece missing from previous patch
There were two i_size_writes in the new truncate
function - we missed one in the last patch.
Noticed by Shaggy when he reviewed.

Thank you Shaggy ...

CC: Shaggy <shaggy@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-26 20:06:29 +00:00
Steve French 3677db10a6 [CIFS] Fix locking problem around some cifs uses of i_size write
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>
2007-02-26 16:46:11 +00:00
Linus Torvalds 9654640d0a Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] One line missing from previous commit
  [CIFS] mtime bounces from local to remote when cifs nocmtime i_flags overwritten
  [CIFS] fix &&/& typo in cifs_setattr()
2007-02-21 13:02:17 -08:00
Tobias Klauser c5a69d57eb Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 20:11:19 +01:00
Uwe Kleine-König 1b3c3714cb Fix typos concerning hierarchy
heirarchical, hierachical -> hierarchical
        heirarchy, hierachy -> hierarchy

Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17 19:23:03 +01:00
Steve French 004c46b9e5 [CIFS] One line missing from previous commit
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-17 04:34:13 +00:00
Steve French 1b2b212603 [CIFS] mtime bounces from local to remote when cifs nocmtime i_flags overwritten
atime flag was also overwritten. Noticed by Shirish when he was debugging
an atime problem.  Should help performance a bit too.

cifs should be getting time stamps from the server (that was the original
intent too)

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-17 04:30:54 +00:00
Steve French c14e894bd4 [CIFS] fix &&/& typo in cifs_setattr()
Thanks to Dirk for pointing this out.

Signed-off-by: Dirk Mueller <dmueller@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-15 01:33:18 +00:00
Linus Torvalds 9468482bd4 Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] on reconnect to Samba - reset the unix capabilities
  [CIFS] Allow update of EOF on remote extend of file
  [CIFS] POSIX CIFS Extensions (continued) - POSIX Open
  [CIFS] Additional POSIX CIFS Extensions infolevels
2007-02-13 21:15:42 -08:00
Steve French 8af1897158 [CIFS] on reconnect to Samba - reset the unix capabilities
After temporary server or network failure and reconneciton, we were not
resending the unix capabilities via SetFSInfo - which confused Samba posix
byte range locking code.

Discovered by jra

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-14 04:42:51 +00:00
Josef 'Jeff' Sipek ee9b6d61a2 [PATCH] Mark struct super_operations const
This patch is inspired by Arjan's "Patch series to mark struct
file_operations and struct inode_operations const".

Compile tested with gcc & sparse.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:47 -08:00
Arjan van de Ven 754661f143 [PATCH] mark struct inode_operations const 1
Many struct inode_operations in the kernel can be "const".  Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data.  In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:46 -08:00
Steve French 7ba526316a [CIFS] Allow update of EOF on remote extend of file
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-08 18:14:13 +00:00
Steve French 595dcfecf6 [CIFS] POSIX CIFS Extensions (continued) - POSIX Open
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-08 18:11:42 +00:00
Steve French 87f440e70e [CIFS] Additional POSIX CIFS Extensions infolevels
also includes cleanup of whitespace/80 columns

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-07 00:29:46 +00:00
Steve French a850790f6c [CIFS] Minor cleanup
Missing tab.  Missing entry in changelog

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-06 20:43:30 +00:00
Steve French 914afcf55a [CIFS] Missing free in error path
Thanks to jra for pointing this out

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-02 14:42:12 +00:00
Steve French 9a0c8230e8 [CIFS] Reduce cifs stack space usage
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
2007-02-02 04:21:57 +00:00
Steve French 030e9d8147 [CIFS] lseek polling returned stale EOF
Fixes Samba bug 4362

Discovered by Jeremy Allison

Clipper database polls on EOF via lseek and can get stale EOF
when file is open on different client

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-02-01 04:27:59 +00:00
Linus Torvalds 5394cd2187 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] Fix oops when Windows server sent bad domain name null terminator
  [CIFS]  cifs sprintf fix
  [CIFS] Remove 2 unneeded kzalloc casts
  [CIFS] Update CIFS version number
2007-01-24 09:46:54 -08:00
Steve French 8e6f195af0 [CIFS] Fix oops when Windows server sent bad domain name null terminator
Fixes RedHat bug 211672

Windows sends one byte (instead of two) of null to terminate final Unicode
string (domain name) in session setup response in some cases - this caused
cifs to misalign some informational strings (making it hard to convert
from UCS16 to UTF8).

Thanks to Shaggy for his help and Akemi Yagi for debugging/testing

Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-01-22 01:19:30 +00:00
Steve French bd2abf177b [CIFS] cifs sprintf fix
Cc: <alert7@xfocus.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-01-21 23:19:01 +00:00
Steve French 76849e3e97 [CIFS] Remove 2 unneeded kzalloc casts
Signed-off-by: Ahmed Darwish <darwish.07@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-01-21 22:56:22 +00:00
Linus Torvalds cb876f4514 Fix up CIFS for "test_clear_page_dirty()" removal
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>
2006-12-23 16:19:07 -08:00
Steve French 405c514f95 [CIFS] Update CIFS version number
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-12-23 18:44:33 +00:00
Robert P. J. Day 5cbded585d [PATCH] getting rid of all casts of k[cmz]alloc() calls
Run this:

	#!/bin/sh
	for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
	  echo "De-casting $f..."
	  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
	done

And then go through and reinstate those cases where code is casting pointers
to non-pointers.

And then drop a few hunks which conflicted with outstanding work.

Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:05:58 -08:00
Andrew Morton 6f88cc2e9c [PATCH] io-accounting-read-accounting cifs fix
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>
2006-12-10 09:55:41 -08:00
Linus Torvalds eb991b3938 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] Fix NTLMv2 mounts to Windows servers
2006-12-08 16:46:30 -08:00
Josef "Jeff" Sipek e6a002964c [PATCH] cifs: change uses of f_{dentry, vfsmnt} to use f_path
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>
2006-12-08 08:28:43 -08:00
Steve French 33ec32fae0 [CIFS] Fix NTLMv2 mounts to Windows servers
Windows servers are pickier about NTLMv2 than Samba.
This enables more secure mounts to Windows (not just Samba)
ie when "sec=ntlmv2" is specified on the mount.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-12-08 04:14:28 +00:00
Nigel Cunningham 7dfb71030f [PATCH] Add include/linux/freezer.h and move definitions from sched.h
Move process freezing functions from include/linux/sched.h to freezer.h, so
that modifications to the freezer or the kernel configuration don't require
recompiling just about everything.

[akpm@osdl.org: fix ueagle driver]
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:27 -08:00
Christoph Lameter e18b890bb0 [PATCH] slab: remove kmem_cache_t
Replace all uses of kmem_cache_t with struct kmem_cache.

The patch was generated using the following script:

	#!/bin/sh
	#
	# Replace one string by another in all the kernel sources.
	#

	set -e

	for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
		quilt add $file
		sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
		mv /tmp/$$ $file
		quilt refresh
	done

The script was run like this

	sh replace kmem_cache_t "struct kmem_cache"

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:25 -08:00
Christoph Lameter e94b176609 [PATCH] slab: remove SLAB_KERNEL
SLAB_KERNEL is an alias of GFP_KERNEL.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:24 -08:00
Christoph Lameter e6b4f8da3a [PATCH] slab: remove SLAB_NOFS
SLAB_NOFS is an alias of GFP_NOFS.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:23 -08:00
Steve French 8d6286fdfd [CIFS] Fix timezone handling on stat to os/2
We were adjusting for timezone on readdir but not on stat

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-11-16 22:48:25 +00:00
Steve French 31ec35d6c8 [CIFS] Incorrect hardlink count when original file is cached (oplocked)
Fixes Samba bug 2823

In this case hardlink count is stale for one of the two inodes (ie the
original file) until it is closed - since revalidate does not go to
server while file is cached locally.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-11-16 20:54:20 +00:00
Steve French f7b2e8c76b [CIFS] Fix minor problem with previous patch
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>
2006-11-09 21:25:37 +00:00
Steve French 6e659c6399 [CIFS] Fix mount failure when domain not specified
Fixes Samba bugzilla #4176

    When users do not specify their domain on mount, 2.6.18 started sending
    default domain instead of a null domain (which was the only way on some
    servers to use a default domain).  Users of 2.6.18 who did not specify
    their domain name on mounts to certain common Windows servers that were
    members of a domain, but not the domain controller, would get mount
    failures which they did not get in 2.6.18

    This fixes that issue and should remove complaints about mount
    behavior changing.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-11-08 23:10:46 +00:00
Steve French 5fe14c851e [CIFS] Explicitly set stat->blksize
CIFS may perform I/O over the network in larger chunks than the page size,
so it should explicitly set stat->blksize to ensure optimal I/O bandwidth

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-11-07 19:26:33 +00:00
Steve French 4891d53956 [CIFS] NFS stress test generates flood of "close with pending write" messages
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>
2006-11-07 16:31:16 +00:00
OGAWA Hirofumi 05ac9d4b3d [PATCH] cifs: ->readpages() fixes
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>
2006-11-03 12:27:56 -08:00
Steve French 8e87d4dc15 [CIFS] report rename failure when target file is locked by Windows
Fixes Samba bugzilla bug # 4182

Rename by handle failures (retry after rename by path) were not
being returned back.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-11-02 03:45:24 +00:00
Steve French 4b952a9b08 [CIFS] Allow null user connections
Some servers are configured to only allow null user mounts for
guest access.  Allow nul user (anonymous) mounts e.g.
	mount -t cifs //server/share /mnt -o username=

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-30 21:46:13 +00:00
Steve French 7ca85ba752 [CIFS] Fix readdir breakage when blocksize set too small
Do not treat filldir running out of space as an error that needs
to be returned.

Fixes Redhat bugzilla bug # 211070

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-30 21:42:57 +00:00
Al Viro 733f99acc8 [PATCH] new cifs endianness bugs
* missing cpu_to_le64() for ChangeTime (introduced by
    [CIFS] Legacy time handling for Win9x and OS/2 part 1)
* missing le16_to_cpu() for DialectIndex (introduced by
    [CIFS] Do not send newer QFSInfo to legacy servers which can not support it)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-15 11:00:58 -07:00
Linus Torvalds 12e36b2f41 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: (27 commits)
  [CIFS] Missing flags2 for DFS
  [CIFS] Workaround incomplete byte length returned by some
  [CIFS] cifs Kconfig: don't select CONNECTOR
  [CIFS] Level 1 QPathInfo needed for proper OS2 support
  [CIFS] fix typo in previous patch
  [CIFS] Fix old DOS time conversion to handle timezone
  [CIFS] Do not need to adjust for Jan/Feb for leap day
  [CIFS] Fix leaps year calculation for years after 2100
  [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers
  [CIFS] Fix compiler warning with previous patch
  [CIFS] Fix typo
  [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about
  [CIFS] Fix readdir of large directories for backlevel servers
  [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path
  [CIFS] Make use of newer QFSInfo dependent on capability bit instead of
  [CIFS] Do not send newer QFSInfo to legacy servers which can not support it
  [CIFS] Fix typo in name of new cifs_show_stats
  [CIFS] Rename server time zone field
  [CIFS] Handle legacy servers which return undefined time zone
  [CIFS] CIFS support for /proc/<pid>/mountstats part 1
  ...

Manual conflict resolution in fs/cifs/connect.c
2006-10-13 08:09:29 -07:00
Steve French 1a4e15a04e [CIFS] Missing flags2 for DFS
Partly suggested by Igor Mammedov

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12 21:33:51 +00:00
Steve French d103e164be [CIFS] Workaround incomplete byte length returned by some
servers on small SMB responses

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12 17:49:24 +00:00
Steve French acf1a1b104 [CIFS] Level 1 QPathInfo needed for proper OS2 support
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12 03:28:28 +00:00
Steve French ddae957da4 [CIFS] fix typo in previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12 01:23:29 +00:00
Steve French 533f90af6d [CIFS] Fix old DOS time conversion to handle timezone
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-12 00:02:32 +00:00
Steve French 70903ca004 [CIFS] Do not need to adjust for Jan/Feb for leap day
calculation in 2100 (year divisible by 100)

Signed-off-by: Yehuda Sadeh Weinraub <Yehuda.Sadeh@expand.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-11 18:49:24 +00:00
Steve French 438dd92626 [CIFS] Fix leaps year calculation for years after 2100
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-11 03:49:30 +00:00
Steve French 268f3be177 [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-06 21:47:09 +00:00
Matt LaPlante cab00891c5 Still more typo fixes
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-10-03 22:36:44 +02:00
Serge E. Hallyn 96b644bdec [PATCH] namespaces: utsname: use init_utsname when appropriate
In some places, particularly drivers and __init code, the init utsns is the
appropriate one to use.  This patch replaces those with a the init_utsname
helper.

Changes: Removed several uses of init_utsname().  Hope I picked all the
	right ones in net/ipv4/ipconfig.c.  These are now changed to
	utsname() (the per-process namespace utsname) in the previous
	patch (2/7)

[akpm@osdl.org: CIFS fix]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrey Savochkin <saw@sw.ru>
Cc: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-02 07:57:21 -07:00
Serge E. Hallyn e9ff3990f0 [PATCH] namespaces: utsname: switch to using uts namespaces
Replace references to system_utsname to the per-process uts namespace
where appropriate.  This includes things like uname.

Changes: Per Eric Biederman's comments, use the per-process uts namespace
	for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c

[jdike@addtoit.com: UML fix]
[clg@fr.ibm.com: cleanup]
[akpm@osdl.org: build fix]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrey Savochkin <saw@sw.ru>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-02 07:57:21 -07:00
Steve French 1a70d6529a [CIFS] Fix compiler warning with previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-02 05:59:18 +00:00
Steve French 947a506795 [CIFS] Fix typo
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-02 05:55:25 +00:00
Steve French b815f1e559 [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about
not setting time on close

Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-02 05:53:29 +00:00
Steve French 203cf2fc13 [CIFS] Fix readdir of large directories for backlevel servers
(were not setting all of resume key)

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-01 19:59:41 +00:00
Dave Hansen ce71ec3684 [PATCH] r/o bind mounts: monitor zeroing of i_nlink
Some filesystems, instead of simply decrementing i_nlink, simply zero it
during an unlink operation.  We need to catch these in addition to the
decrement operations.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:30 -07:00
Dave Hansen d8c76e6f45 [PATCH] r/o bind mount prepwork: inc_nlink() helper
This is mostly included for parity with dec_nlink(), where we will have some
more hooks.  This one should stay pretty darn straightforward for now.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:30 -07:00
Dave Hansen 9a53c3a783 [PATCH] r/o bind mounts: unlink: monitor i_nlink
When a filesystem decrements i_nlink to zero, it means that a write must be
performed in order to drop the inode from the filesystem.

We're shortly going to have keep filesystems from being remounted r/o between
the time that this i_nlink decrement and that write occurs.

So, add a little helper function to do the decrements.  We'll tie into it in a
bit to note when i_nlink hits zero.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:30 -07:00
Badari Pulavarty ee0b3e671b [PATCH] Remove readv/writev methods and use aio_read/aio_write instead
This patch removes readv() and writev() methods and replaces them with
aio_read()/aio_write() methods.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:28 -07:00
Badari Pulavarty 027445c372 [PATCH] Vectorize aio_read/aio_write fileop methods
This patch vectorizes aio_read() and aio_write() methods to prepare for
collapsing all aio & vectored operations into one interface - which is
aio_read()/aio_write().

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Michael Holzheu <HOLZHEU@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01 00:39:28 -07:00
Steve French 18f75ca0dc [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path
Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-10-01 03:13:01 +00:00
David Howells d366e40a1c [PATCH] BLOCK: Remove no-longer necessary linux/buffer_head.h inclusions [try #6]
Remove inclusions of linux/buffer_head.h that are no longer necessary due to the
transfer of a number of things out of there.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2006-09-30 20:52:31 +02:00
David Howells 4cb50dc2ea [PATCH] BLOCK: Remove no-longer necessary linux/mpage.h inclusions [try #6]
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>
2006-09-30 20:52:30 +02:00
David Howells 36695673b0 [PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6]
Move common FS-specific ioctls from linux/ext2_fs.h to linux/fs.h as FS_IOC_*
and FS_IOC32_* and have the users of them use those as a base.

Also move the GETFLAGS/SETFLAGS flags to linux/fs.h as FS_*_FL macros, and then
have the other users use them as a base.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2006-09-30 20:52:28 +02:00
Steve French de7ed55dbb [CIFS] Make use of newer QFSInfo dependent on capability bit instead of
whether we negotiated legacy lanman dialect so we do not keep retrying
for mount to WindowsME

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-30 13:25:52 +00:00
Steve French 9ac00b7d96 [CIFS] Do not send newer QFSInfo to legacy servers which can not support it
Fix dialect negotiation to save off when we have negotiated lanman.
This allows us to avoid sending some somewhat newer requests that the server
can not handle and go directly to the older version (infolevel) of the same
call. Make sure we try to negotiate a level which allows us to get the
server OS (which we check so we can detect Win9x vs. other legacy servers
and eventually work around the Win9x DOS time bug (they reverse date/time
fields).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-30 04:13:17 +00:00
Steve French f46d3e1190 [CIFS] Fix typo in name of new cifs_show_stats
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-30 01:08:55 +00:00
Steve French 175ec9e11c [CIFS] Rename server time zone field
Server time zone is not really a time zone, rather a time adjustement
in seconds.

CC: Guenter Kukkukk <linux@kukkukk.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-30 01:07:38 +00:00
Steve French 25ee4a98c6 [CIFS] Handle legacy servers which return undefined time zone
Signed-off-by: Guenter Kukkukk <linux@kukkukk.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-30 00:54:23 +00:00
Steve French bf97d28711 [CIFS] CIFS support for /proc/<pid>/mountstats part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 21:34:06 +00:00
Steve French a3ab41f10e [CIFS] Fix build break ifdef in wrong place
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 20:52:08 +00:00
Steve French e10847ed49 [CIFS] More removing of unused functions
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 20:49:01 +00:00
Steve French 2eaf55862e [CIFS] Remove unused prototypes
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 20:41:48 +00:00
Steve French e33c74d06e [CIFS] Fix build break
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 20:35:48 +00:00
Steve French 2cd646a2d1 [CIFS] Remove static and unused symbols
Most cases of the ones found by Shaggy by
	"make namespacecheck"
could be removed or made static

Ack: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 19:43:08 +00:00
Steve French 1bd5bbcb65 [CIFS] Legacy time handling for Win9x and OS/2 part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-28 03:35:57 +00:00
Theodore Ts'o ba52de123d [PATCH] inode-diet: Eliminate i_blksize from the inode structure
This eliminates the i_blksize field from struct inode.  Filesystems that want
to provide a per-inode st_blksize can do so by providing their own getattr
routine instead of using the generic_fillattr() function.

Note that some filesystems were providing pretty much random (and incorrect)
values for i_blksize.

[bunk@stusta.de: cleanup]
[akpm@osdl.org: generic_fillattr() fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:18 -07:00
Alexey Dobriyan 1a1d92c10d [PATCH] Really ignore kmem_cache_destroy return value
* Rougly half of callers already do it by not checking return value
* Code in drivers/acpi/osl.c does the following to be sure:

	(void)kmem_cache_destroy(cache);

* Those who check it printk something, however, slab_error already printed
  the name of failed cache.
* XFS BUGs on failed kmem_cache_destroy which is not the decision
  low-level filesystem driver should make. Converted to ignore.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:10 -07:00
Steve French 0889a9441d CIFS: Use SEEK_END instead of hardcoded value
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-23 22:11:07 +00:00
Steve French b8c06a2ab6 [CIFS] statfs for cifs unix extensions no longer experimental
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-22 01:14:52 +00:00
Steve French 6b70c9559b [CIFS] New POSIX locking code not setting rc properly to zero on successful
unlock in case where server does not support POSIX locks and nobrl is
not specified.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-21 07:35:29 +00:00
Steve French 2fe87f02a0 [CIFS] Support deep tree mounts (e.g. mounts to //server/share/path)
Samba bugzilla #4040

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-09-21 07:02:52 +00:00
Steve French b835bebe95 [CIFS] Fix CIFS readdir access denied when SE Linux enabled
CIFS had one path in which dentry was instantiated before the corresponding
inode metadata was filled in.

Fixes Redhat bugzilla bug #163493

Signed-off-by: Steve French <sfrench@us.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com>
Acked-by: Dave Kleikamp <shaggy@austin.ibm.com>
2006-09-06 22:02:22 +00:00
Steve French ea4c07d780 [CIFS] Do not send Query All EAs SMB when mount option nouser_xattr
specified

Pointed out by Bjoern Jacke

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-08-16 19:44:25 +00:00
Steve French 5ddaa683a5 [CIFS] endian errors in lanman protocol support
le16 compared to host-endian constant
	u8 fed to le32_to_cpu()
	le16 compared to host-endian constant

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-08-15 13:35:48 +00:00
Steve French e466e4876b [CIFS] Fix oops in cifs_close due to unitialized lock sem and list in
new POSIX locking code

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-08-15 13:07:18 +00:00
Steve French 66abda5e1f [CIFS] Fix oops when negotiating lanman and no password specified
Pointed out by Guenter Kukkukk

Signed-of-by: Steve French <sfrench@us.ibm.com>
(cherry picked from bbf33d512da608c7221fec42b56b9ef89c25a5ee commit)
2006-08-11 21:29:13 +00:00
Jeremy Allison 7ee1af765d [CIFS]
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)
2006-08-11 21:28:47 +00:00
Steve French 6c3d8909d8 [CIFS] Allow cifsd to suspend if connection is lost
Make cifsd allow us to suspend if it has lost the connection with a server

Ref: http://bugzilla.kernel.org/show_bug.cgi?id=6811

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Steve French <sfrench@us.ibm.com>
(cherry picked from 27bd6cd87b0ada66515ad49bc346d77d1e9d3e05 commit)
2006-08-11 21:28:26 +00:00
Steve French 5da07b0208 [CIFS] Make midState usage more consistent
Although harmless, we were sometimes treating midState like it contained
flags but they are exclusive states, and this makes that more clear.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
(cherry picked from 586c057c3a68dd6ae0f3ba94fbf76798b1558074 commit)
2006-08-11 21:28:02 +00:00
Steve French 14a441a2b4 [CIFS] spinlock protect read of last srv response time in timeout path
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
(cherry picked from b33a3f55e54fd210fc043eafcf83728b03bc9e02 commit)
2006-08-11 21:27:41 +00:00
Steve French 3a5ff61c18 [CIFS] Do not time out posix brl requests when using new posix setfileinfo
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)
2006-08-11 21:27:07 +00:00
Jörn Engel 6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Adrian Bunk 0418726bb5 typo fixes: aquire -> acquire
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-30 18:23:04 +02:00
Christoph Hellwig f5e54d6e53 [PATCH] mark address_space_operations const
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>
2006-06-28 14:59:04 -07:00
Linus Torvalds f17a2686b1 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: (25 commits)
  [CIFS] Fix authentication choice so we do not force NTLMv2 unless the
  [CIFS] Fix alignment of unicode strings in previous patch
  [CIFS] Fix allocation of buffers for new session setup routine to allow
  [CIFS] Remove calls to to take f_owner.lock
  [CIFS] remove some redundant null pointer checks
  [CIFS] Fix compile warning when CONFIG_CIFS_EXPERIMENTAL is off
  [CIFS] Enable sec flags on mount for cifs (part one)
  [CIFS] Fix suspend/resume problem which causes EIO on subsequent access to
  [CIFS] fix minor compile warning when config_cifs_weak_security is off
  [CIFS] NTLMv2 support part 5
  [CIFS] Add support for readdir to legacy servers
  [CIFS] NTLMv2 support part 4
  [CIFS] NTLMv2 support part 3
  [CIFS] NTLMv2 support part 2
  [CIFS] Fix mask so can set new cifs security flags properly
  CIFS] Support for older servers which require plaintext passwords - part 2
  [CIFS] Support for older servers which require plaintext passwords
  [CIFS] Fix mapping of old SMB return code Invalid Net Name so it is
  [CIFS] Missing brace
  [CIFS] Do not overwrite aops
  ...
2006-06-27 18:31:57 -07:00
Steve French f40c562855 [CIFS] Fix authentication choice so we do not force NTLMv2 unless the
user specifies it is required or turns of ntlm

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-28 00:13:38 +00:00
Steve French 0223cf0b10 [CIFS] Fix alignment of unicode strings in previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-27 19:50:57 +00:00
Steve French 750d1151a6 [CIFS] Fix allocation of buffers for new session setup routine to allow
longer user and domain names and allow passing sec options on mount

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-27 06:28:30 +00:00
Ingo Molnar 124a27fe32 [CIFS] Remove calls to to take f_owner.lock
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>
2006-06-26 13:47:59 +00:00
Steve French cd49b492fe [CIFS] remove some redundant null pointer checks
some of them pointed out by Dave Jones

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-26 04:22:36 +00:00
Steve French f90f00a358 [CIFS] Fix compile warning when CONFIG_CIFS_EXPERIMENTAL is off
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-25 15:59:32 +00:00
Steve French bbe5d235ee Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2006-06-25 15:57:32 +00:00
Trond Myklebust 816724e65c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:

	fs/nfs/inode.c
	fs/super.c

Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch
'VFS: Permit filesystem to override root dentry on mount'
2006-06-24 13:07:53 -04:00
Miklos Szeredi 75e1fcc0b1 [PATCH] vfs: add lock owner argument to flush operation
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>
2006-06-23 07:43:02 -07:00
OGAWA Hirofumi 111ebb6e6f [PATCH] writeback: fix range handling
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>
2006-06-23 07:42:49 -07:00
David Howells 726c334223 [PATCH] VFS: Permit filesystem to perform statfs with a known root dentry
Give the statfs superblock operation a dentry pointer rather than a superblock
pointer.

This complements the get_sb() patch.  That reduced the significance of
sb->s_root, allowing NFS to place a fake root there.  However, NFS does
require a dentry to use as a target for the statfs operation.  This permits
the root in the vfsmount to be used instead.

linux/mount.h has been added where necessary to make allyesconfig build
successfully.

Interest has also been expressed for use with the FUSE and XFS filesystems.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nathan Scott <nathans@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23 07:42:45 -07:00
David Howells 454e2398be [PATCH] VFS: Permit filesystem to override root dentry on mount
Extend the get_sb() filesystem operation to take an extra argument that
permits the VFS to pass in the target vfsmount that defines the mountpoint.

The filesystem is then required to manually set the superblock and root dentry
pointers.  For most filesystems, this should be done with simple_set_mnt()
which will set the superblock pointer and then set the root dentry to the
superblock's s_root (as per the old default behaviour).

The get_sb() op now returns an integer as there's now no need to return the
superblock pointer.

This patch permits a superblock to be implicitly shared amongst several mount
points, such as can be done with NFS to avoid potential inode aliasing.  In
such a case, simple_set_mnt() would not be called, and instead the mnt_root
and mnt_sb would be set directly.

The patch also makes the following changes:

 (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
     pointer argument and return an integer, so most filesystems have to change
     very little.

 (*) If one of the convenience function is not used, then get_sb() should
     normally call simple_set_mnt() to instantiate the vfsmount. This will
     always return 0, and so can be tail-called from get_sb().

 (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
     dcache upon superblock destruction rather than shrink_dcache_anon().

     This is required because the superblock may now have multiple trees that
     aren't actually bound to s_root, but that still need to be cleaned up. The
     currently called functions assume that the whole tree is rooted at s_root,
     and that anonymous dentries are not the roots of trees which results in
     dentries being left unculled.

     However, with the way NFS superblock sharing are currently set to be
     implemented, these assumptions are violated: the root of the filesystem is
     simply a dummy dentry and inode (the real inode for '/' may well be
     inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
     with child trees.

     [*] Anonymous until discovered from another tree.

 (*) The documentation has been adjusted, including the additional bit of
     changing ext2_* into foo_* in the documentation.

[akpm@osdl.org: convert ipath_fs, do other stuff]
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nathan Scott <nathans@sgi.com>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23 07:42:45 -07:00
Steve French 189acaaef8 [CIFS] Enable sec flags on mount for cifs (part one)
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-23 02:33:48 +00:00
Pavel Machek 0fd1ffe063 [CIFS] Fix suspend/resume problem which causes EIO on subsequent access to
the mount.

Signed-off-by: Pavel Machek <pavel@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-13 21:31:39 +00:00
Steve French 6344a423e5 [CIFS] fix minor compile warning when config_cifs_weak_security is off
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-12 04:18:35 +00:00
Trond Myklebust 8b512d9a88 VFS: Remove dependency of ->umount_begin() call on MNT_FORCE
Allow filesystems to decide to perform pre-umount processing whether or not
MNT_FORCE is set.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-06-09 09:34:18 -04:00
Steve French 1717ffc588 [CIFS] NTLMv2 support part 5
NTLMv2 authentication (stronger authentication than default NTLM) which
many servers support now works.  There was a problem with the construction
of the security blob in the older code.  Currently requires
	/proc/fs/cifs/Experimental to be set to 2
and
	/proc/fs/cifs/SecurityFlags to be set to 0x4004 (to require using
	NTLMv2 instead of default of NTLM)

Next we will check signing to make sure optional NTLMv2 packet signing also
works.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-08 05:41:32 +00:00
Steve French 5bafd76593 [CIFS] Add support for readdir to legacy servers
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>
2006-06-07 00:18:43 +00:00
Steve French a8ee03441f [CIFS] NTLMv2 support part 4
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-05 23:34:19 +00:00
Steve French 6d027cfdb1 [CIFS] NTLMv2 support part 3
Response struct filled in exacty for 16 byte hash which we need to check
more to make sure it works.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-05 16:26:05 +00:00
Steve French f64b23ae4a [CIFS] NTLMv2 support part 2
Still need to fill in response structure and check that hash works

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-05 05:27:37 +00:00
Steve French 9312f6754d [CIFS] Fix mask so can set new cifs security flags properly
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-04 22:21:07 +00:00
Steve French 254e55ed03 CIFS] Support for older servers which require plaintext passwords - part 2
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-04 05:53:15 +00:00
Steve French bdc4bf6e8a [CIFS] Support for older servers which require plaintext passwords
disabled by default, but can be enabled via proc for servers which
require such support.  Also includes support for setting security
flags for cifs.  See fs/cifs/README

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-02 22:57:13 +00:00
Steve French 43411d699e [CIFS] Fix mapping of old SMB return code Invalid Net Name so it is
recognized on mount

the old mapping of this was to ENODEV (instead of ENXIO) - but
ENODEV is what mount returns when the cifs driver will not load
so change this to map to ENXIO (which was what the equivalent
condition returned for mapping errors from more modern servers)

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-02 18:17:11 +00:00
Steve French 7a0d223176 [CIFS] Missing brace 2006-06-01 19:44:37 +00:00
Dave Kleikamp 273d81d6ad [CIFS] Do not overwrite aops
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>
2006-06-01 19:41:23 +00:00
Steve French 3856a9d443 [CIFS] Fix minor build breaks due to cifs kconfig issues
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-01 19:38:46 +00:00
Steve French 7c7b25bc8e [CIFS] Support for setting up SMB sessions to legacy lanman servers part 2 2006-06-01 19:20:10 +00:00
Steve French 9c53588ec9 [CIFS] Missing include shows up on some architectures
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-06-01 05:09:10 +00:00
Steve French 3979877e56 [CIFS] Support for setting up SMB sessions to legacy lanman servers 2006-05-31 22:40:51 +00:00
Steve French 26a21b980b [CIFS] Cleanup extra whitespace in dmesg logging. Update cifs change log 2006-05-31 18:05:34 +00:00
Steve French 55aa2e097d [[CIFS] Pass truncate open flag through on file open in case setattr fails
on set size to zero.

Signed-off-by: Sebastian Voitzsch <sebastoam/vpotzscj@web.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:09:31 +00:00
Steve French 08775834c4 [CIFS] Fix typos in previous fix
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:08:26 +00:00
Steve French cec6815a12 [CIFS] endian fix for new POSIX byte range lock support
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:07:17 +00:00
Steve French a424f8bfcb [CIFS] fix memory leak in cifs session info struct on reconnect
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:06:04 +00:00
Steve French c01f36a896 [CIFS] ACPI suspend oops
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>
2006-05-30 18:05:10 +00:00
Steve French a878fb2218 [CIFS] Do not limit the length of share names (was 100 for whole UNC name)
during mount. Especially important for some non-Western languages.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:04:19 +00:00
Steve French fc94cdb944 [CIFS] Fix new POSIX Locking for setting lock_type correctly on unlock
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-05-30 18:03:32 +00:00
Steve French 301dc3e6f6 [CIFS] Fix compile error when CONFIG_CIFS_EXPERIMENTAL is undefined
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-04-24 16:24:54 +00:00
Steve French b66ac3ea21 [CIFS] Fix typo in previous
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-04-23 01:54:50 +00:00
Steve French 60808233f3 [CIFS] Readdir fixes to allow search to start at arbitrary position
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>
2006-04-22 15:53:05 +00:00
Steve French 45af7a0f2e [CIFS] Use the kthread_ API instead of opencoding lots of hairy code for kernel
thread creation and teardown.

It does not move the cifsd thread handling to kthread due to problems
found in testing with wakeup of threads blocked in the socket peek api,
but the other cifs kernel threads now use kthread.
Also cleanup cifs_init to properly unwind when thread creation fails.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-04-21 22:52:25 +00:00
Steve French 296034f7de [CIFS] Don't allow a backslash in a path component
Unless Posix paths have been negotiated, the backslash, "\", is not a valid
character in a path component.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French  <sfrench@us.ibm.com>
2006-04-21 18:18:37 +00:00
Steve French 0bd4fa977f [CIFS] [CIFS] Do not take rename sem on most path based calls (during
building of full path) to avoid hang rename/readdir hang

Reported by Alan Tyson

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-04-21 18:17:42 +00:00
Steve French 06bcfedd05 [CIFS] Fix typo in earlier cifs_unlink change and protect one
extra path.

Since cifs_unlink can also be called from rename path and there
was one report of oops am making the extra check for null inode.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-31 22:43:50 +00:00
Steve French e9917a000f [CIFS] Incorrect signature sent on SMB Read
Fixes Samba bug 3621 and kernel.org bug 6147

For servers which require SMB/CIFS packet signing, we were sending the
wrong signature (all zeros) on SMB Read request.  The new cifs routine
to do signatures across an iovec was not complete - and SMB Read, unlike
the new SMBWrite2, did not fall back to the older routine (ie use
SendReceive vs. the more efficient SendReceive2 ie used the older
cifs_sign_smb vs. the disabled  cifs_sign_smb2) for calculating signatures.

This finishes up cifs_sign_smb2/cifs_calc_signature2 so that the callers
of SendReceive2 can get SMB/CIFS packet signatures.

Now that cifs_sign_smb2 is supported, we could start using it in
the write path but this smaller fix does not include the change
to use SMBWrite2 when signatures are required (which when enabled
will make more Writes more efficient and alloc less memory).
Currently Write2 is only used when signatures are not
required at the moment but after more testing we will enable
that as well).

Thanks to James Slepicka and Sam Flory for initial investigation.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-31 21:22:00 +00:00
Steve French 6910ab30a2 [CIFS] Fix unlink oops when indirectly called in rename error path
under heavy stress.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-31 03:37:08 +00:00
Steve French d62e54abca Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-31 03:35:56 +00:00
Arjan van de Ven 4b6f5d20b0 [PATCH] Make most file operations structs in fs/ const
This is a conversion to make the various file_operations structs in fs/
const.  Basically a regexp job, with a few manual fixups

The goal is both to increase correctness (harder to accidentally write to
shared datastructures) and reducing the false sharing of cachelines with
things that get dirty in .data (while .rodata is nicely read only and thus
cache clean)

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-28 09:16:06 -08:00
Andrew Morton 5515eff811 [PATCH] 2tb-files-add-blkcnt_t-fixes
Cc: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-26 08:57:00 -08:00
Matthew Dobson 93d2341c75 [PATCH] mempool: use mempool_create_slab_pool()
Modify well over a dozen mempool users to call mempool_create_slab_pool()
rather than calling mempool_create() with extra arguments, saving about 30
lines of code and increasing readability.

Signed-off-by: Matthew Dobson <colpatch@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-26 08:57:00 -08:00
NeilBrown 3978d7179d [PATCH] Make address_space_operations->sync_page return void
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>
2006-03-26 08:56:55 -08:00
Alexey Dobriyan 53b3531bbb [PATCH] s/;;/;/g
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-24 07:33:24 -08:00
Paul Jackson fffb60f93c [PATCH] cpuset memory spread: slab cache format
Rewrap the overly long source code lines resulting from the previous
patch's addition of the slab cache flag SLAB_MEM_SPREAD.  This patch
contains only formatting changes, and no function change.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-24 07:33:23 -08:00
Paul Jackson 4b6a9316fa [PATCH] cpuset memory spread: slab cache filesystems
Mark file system inode and similar slab caches subject to SLAB_MEM_SPREAD
memory spreading.

If a slab cache is marked SLAB_MEM_SPREAD, then anytime that a task that's
in a cpuset with the 'memory_spread_slab' option enabled goes to allocate
from such a slab cache, the allocations are spread evenly over all the
memory nodes (task->mems_allowed) allowed to that task, instead of favoring
allocation on the node local to the current cpu.

The following inode and similar caches are marked SLAB_MEM_SPREAD:

    file                               cache
    ====                               =====
    fs/adfs/super.c                    adfs_inode_cache
    fs/affs/super.c                    affs_inode_cache
    fs/befs/linuxvfs.c                 befs_inode_cache
    fs/bfs/inode.c                     bfs_inode_cache
    fs/block_dev.c                     bdev_cache
    fs/cifs/cifsfs.c                   cifs_inode_cache
    fs/coda/inode.c                    coda_inode_cache
    fs/dquot.c                         dquot
    fs/efs/super.c                     efs_inode_cache
    fs/ext2/super.c                    ext2_inode_cache
    fs/ext2/xattr.c (fs/mbcache.c)     ext2_xattr
    fs/ext3/super.c                    ext3_inode_cache
    fs/ext3/xattr.c (fs/mbcache.c)     ext3_xattr
    fs/fat/cache.c                     fat_cache
    fs/fat/inode.c                     fat_inode_cache
    fs/freevxfs/vxfs_super.c           vxfs_inode
    fs/hpfs/super.c                    hpfs_inode_cache
    fs/isofs/inode.c                   isofs_inode_cache
    fs/jffs/inode-v23.c                jffs_fm
    fs/jffs2/super.c                   jffs2_i
    fs/jfs/super.c                     jfs_ip
    fs/minix/inode.c                   minix_inode_cache
    fs/ncpfs/inode.c                   ncp_inode_cache
    fs/nfs/direct.c                    nfs_direct_cache
    fs/nfs/inode.c                     nfs_inode_cache
    fs/ntfs/super.c                    ntfs_big_inode_cache_name
    fs/ntfs/super.c                    ntfs_inode_cache
    fs/ocfs2/dlm/dlmfs.c               dlmfs_inode_cache
    fs/ocfs2/super.c                   ocfs2_inode_cache
    fs/proc/inode.c                    proc_inode_cache
    fs/qnx4/inode.c                    qnx4_inode_cache
    fs/reiserfs/super.c                reiser_inode_cache
    fs/romfs/inode.c                   romfs_inode_cache
    fs/smbfs/inode.c                   smb_inode_cache
    fs/sysv/inode.c                    sysv_inode_cache
    fs/udf/super.c                     udf_inode_cache
    fs/ufs/super.c                     ufs_inode_cache
    net/socket.c                       sock_inode_cache
    net/sunrpc/rpc_pipe.c              rpc_inode_cache

The choice of which slab caches to so mark was quite simple.  I marked
those already marked SLAB_RECLAIM_ACCOUNT, except for fs/xfs, dentry_cache,
inode_cache, and buffer_head, which were marked in a previous patch.  Even
though SLAB_RECLAIM_ACCOUNT is for a different purpose, it marks the same
potentially large file system i/o related slab caches as we need for memory
spreading.

Given that the rule now becomes "wherever you would have used a
SLAB_RECLAIM_ACCOUNT slab cache flag before (usually the inode cache), use
the SLAB_MEM_SPREAD flag too", this should be easy enough to maintain.
Future file system writers will just copy one of the existing file system
slab cache setups and tend to get it right without thinking.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-24 07:33:23 -08:00
Theodore Ts'o 9b04c997b1 [PATCH] vfs: MS_VERBOSE should be MS_SILENT
The meaning of MS_VERBOSE is backwards; if the bit is set, it really means,
"don't be verbose".  This is confusing and counter-intuitive.

In addition, there is also no way to set the MS_VERBOSE flag in the
mount(8) program in util-linux, but interesting, it does define options
which would do the right thing if MS_SILENT were defined, which
unfortunately we do not:

#ifdef MS_SILENT
  { "quiet",    0, 0, MS_SILENT    },   /* be quiet  */
  { "loud",     0, 1, MS_SILENT    },   /* print out messages. */
#endif

So the obvious fix is to deprecate the use of MS_VERBOSE and replace it
with MS_SILENT.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-24 07:33:15 -08:00
Arjan van de Ven a11f3a0574 [PATCH] sem2mutex: vfs_rename_mutex
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>
2006-03-23 07:38:12 -08:00
Alexey Dobriyan 4de151d8cd It's UTF-8
Fix some comments to "UTF-8".

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-22 00:13:35 +01:00
Steve French 88274815f7 [CIFS] Fix two remaining coverity scan tool warnings.
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-09 22:21:45 +00:00
Steve French e77e6f3be9 [CIFS] Always match oplock break (cache notification) to the right tcp
session when multiply mounted.

Fixes slow response when cifs client is mounted to shares on multiple
servers and oplock break occurs (usually due to attempt to multiply open a
file).  When treeids on mutiple mounted shares match and we find the wrong
match first, we searched for the wrong cached files to send oplock break
response for which usually meant that no matching file was found and thus
the server would have to timeout the notification.  Oplock break timeout is
about 20 seconds on some servers so this could cause significantly slower
performance on file open calls in a few cases (in particular when multiple
shares are mounted from multiple servers, tree ids match, and we have a
cached file which is later opened multiple times).  This was the most
important of the bugs that was found and fixed at Connectathon
(interoperability testing event) this week.

Acked-by:  Shaggy (shaggy@austin.ibm.com)
Signed-off-by: Steve French (sfrench@us.ibm.com)
2006-03-05 03:39:55 +00:00
Steve French beb84dc818 [CIFS] Set correct lock type on new posix unlock call
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-03 23:36:34 +00:00
Steve French 13298defe5 [CIFS] Upate cifs change log
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-03 10:45:19 +00:00
Steve French d7c8c94d3e [CIFS] Fix slow oplock break response when mounts to different
servers have same tid and we try to match oplock break to wrong tid.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-03 10:43:49 +00:00
Steve French 083d3a2cff [CIFS] Workaround various server bugs found in testing at connectathon
- slow down negprot 1ms during mount when RFC1001 over port 139
	to give buggy servers time to clear sess_init
	- remap some plausible but incorrect SMB return codes to the
	right ones in truncate and hardlink paths

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-03 09:53:36 +00:00
Steve French a4e85b5f62 [CIFS] Allow fallback for setting file size to Procom SMB server when
returns error invalid level

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-02 03:53:17 +00:00
Steve French 82940a4658 [CIFS] Make POSIX CIFS Extensions SetFSInfo match exactly what we want
not just the posix path feature.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-02 03:24:57 +00:00
Steve French 46c79a645a [CIFS] Move noisy debug message (triggerred by some older servers) from
error to informational unless frame is rejected.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-02 00:07:08 +00:00
Steve French f26282c9af [CIFS] Use correct pid on new cifs posix byte range lock call
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-03-01 09:17:37 +00:00
Steve French 08547b036b [CIFS] Add posix (advisory) byte range locking support to cifs client
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>
2006-02-28 22:39:25 +00:00
Steve French d47d7c1a85 [CIFS] CIFS readdir perf optimizations part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-02-28 03:45:48 +00:00
Steve French 4b8f930ff8 [CIFS] Free small buffers earlier so we exceed the cifs
small req buffer pool less often.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-02-26 16:41:18 +00:00
Steve French 184ed2110a [CIFS] Fix large (ie over 64K for MaxCIFSBufSize) buffer case for wrapping
bcc on read response and for wrapping sessionsetup maxbufsize field

Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-02-24 06:15:11 +00:00
Steve French 5d2f248a5f Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
2006-02-22 23:38:53 +00:00