Commit Graph

520 Commits

Author SHA1 Message Date
Steve French 630f3f0c45 [CIFS] acl support part 6
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
CC: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-25 21:17:17 +00:00
Steve French 44093ca2fe [CIFS] acl support part 6
CC: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-23 21:22:55 +00:00
Parag Warudkar c94897790e [CIFS] remove unused funtion compile warning when experimental off
get rid of couple of unused function warnings which
show up when CONFIG_CIFS_EXPERIMENTAL is not defined - wrap them in
#ifdef CONFIG_CIFS_EXPERIMENTAL. Patch against current git.

Signed-off-by: Parag Warudkar <kernel-stuff@comcast.net>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-23 18:09:48 +00:00
Christoph Hellwig 3965516440 exportfs: make struct export_operations const
Now that nfsd has stopped writing to the find_exported_dentry member we an
mark the export_operations const

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: <linux-ext4@vger.kernel.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: David Chinner <dgc@sgi.com>
Cc: Timothy Shimmin <tes@sgi.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Chris Mason <mason@suse.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-22 08:13:21 -07:00
Steve French 4879b44829 [CIFS] ACL support part 5
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-19 21:57:39 +00:00
Linus Torvalds 2843483d2e 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: (51 commits)
  [CIFS] log better errors on failed mounts
  [CIFS] Return better error when server requires signing but client forbids
  [CIFS] fix typo
  [CIFS] acl support part 4
  [CIFS] Fix minor problems noticed by scan
  [CIFS] fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread
  [CIFS] build break
  [CIFS] endian fixes
  [CIFS] endian fixes in new acl code
  [CIFS] Fix some endianness problems in new acl code
  [CIFS] missing #endif from a previous patch
  [CIFS] formatting fixes
  [CIFS] Break up unicode_sessetup string functions
  [CIFS] parse server_GUID in SPNEGO negProt response
  [CIFS]
  [CIFS] Fix endian conversion problem in posix mkdir
  [CIFS] fix build break when lanman not enabled
  [CIFS] remove two sparse warnings
  [CIFS] remove compile warnings when debug disabled
  [CIFS] CIFS ACL support part 3
  ...
2007-10-19 12:00:58 -07:00
Pavel Emelyanov ba25f9dcc4 Use helpers to obtain task pid in printks
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:43 -07:00
Steve French a761ac579b [CIFS] log better errors on failed mounts
Also returns more accurate errors to mount for the cases of
account expired and password expired

Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-18 21:45:27 +00:00
Jeff Layton d32c4f2626 CIFS: ignore mode change if it's just for clearing setuid/setgid bits
If the ATTR_KILL_S*ID bits are set then any mode change is only for clearing
the setuid/setgid bits.  For CIFS, skip the mode change and let the server
handle it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:22 -07:00
Steve French abb63d6c3d [CIFS] Return better error when server requires signing but client forbids
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-18 02:58:40 +00:00
Steve French d628ddb62d [CIFS] fix typo
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 23:06:07 +00:00
Steve French a750e77c21 [CIFS] acl support part 4
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 22:50:39 +00:00
Steve French d5d1850109 [CIFS] Fix minor problems noticed by scan
Coverity scan pointed out some minor possible errors.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 21:31:52 +00:00
Steve French c18c732ec6 [CIFS] fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread
When kernel_recvmsg returns -EAGAIN or -ERESTARTSYS, then
cifs_demultiplex_thread sleeps for a bit and then tries the read again.
When it does this, it's not zeroing out the length and that throws off
the value of total_read. Fix it to zero out the length.

Can cause memory corruption:
If kernel_recvmsg returns an error and total_read is a large enough
value, then we'll end up going through the loop again. total_read will
be a bogus value, as will (pdu_length-total_read). When this happens we
end up calling kernel_recvmsg with a bogus value (possibly larger than
the current iov_len).

At that point, memcpy_toiovec can overrun iov. It will start walking
up the stack, casting other things that are there to struct iovecs
(since it assumes that it's been passed an array of them). Any pointer
on the stack at an address above the kvec is a candidate for corruption
here.

Many thanks to Ulrich Obergfell for pointing this out.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 18:01:11 +00:00
Christoph Lameter 4ba9b9d0ba Slab API: remove useless ctor parameter and reorder parameters
Slab constructors currently have a flags parameter that is never used.  And
the order of the arguments is opposite to other slab functions.  The object
pointer is placed before the kmem_cache pointer.

Convert

        ctor(void *object, struct kmem_cache *s, unsigned long flags)

to

        ctor(struct kmem_cache *s, void *object)

throughout the kernel

[akpm@linux-foundation.org: coupla fixes]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17 08:42:45 -07:00
Steve French adddd49ddf [CIFS] build break
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 02:48:17 +00:00
Steve French adbc03587c [CIFS] endian fixes
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-17 02:12:46 +00:00
Dave Kleikamp ce51ae14ae [CIFS] endian fixes in new acl code
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 21:35:39 +00:00
Steve French af6f4612fd [CIFS] Fix some endianness problems in new acl code
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 18:40:37 +00:00
Steve French 016ec75f1a [CIFS] missing #endif from a previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 18:10:10 +00:00
Cyrill Gorcunov 6345a3a880 [CIFS] formatting fixes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 17:57:55 +00:00
Jeff Layton 0d3a01fada [CIFS] Break up unicode_sessetup string functions
SPNEGO setup needs only some of these strings. Break up
unicode_ssetup_strings so we can call them individually.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 17:32:19 +00:00
Jeff Layton e187e44eb8 [CIFS] parse server_GUID in SPNEGO negProt response
SPNEGO NegProt response also contains a server_GUID. Parse it as we
would for RawNTLMSSP.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 17:10:44 +00:00
Jeff Layton 7111d2144f [CIFS]
[CIFS] fix error message about packet signing

When packet signing is disabled and the server requires it, cifs prints
an error message. The current message refers to a file in /proc that no
longer exists. Fix it to refer to the correct file.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-16 16:50:25 +00:00
Cyril Gorcunov 8f2376adfb [CIFS] Fix endian conversion problem in posix mkdir
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-14 17:58:43 +00:00
Steve French 516897a208 [CIFS] fix build break when lanman not enabled
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-12 19:24:06 +00:00
Steve French 2c2130e16f [CIFS] remove two sparse warnings
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-12 19:10:28 +00:00
Steve French 8f18c1316b [CIFS] remove compile warnings when debug disabled
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-12 18:54:12 +00:00
Steve French 297647c21f [CIFS] CIFS ACL support part 3
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-12 04:11:59 +00:00
Steve French a013689ddb [CIFS] Fix cifsd so shuts down when signing fails during mount
Fixes two problems:
1) we dropped down to negotiating lanman if we did not recognize the
mechanism (krb5 e.g.)
2) we did not stop cifsd (thus will fail when doing rmod cifs with
slab free errors) when we fail tcon but have a bad session (which is
the case in which signing is required but we don't allow signing on
the client)

It also turns on extended security flag in the header when passing
"sec=krb5" on mount command (although kerberos support is not done of
course)

Acked-by: Jeff Layton <jlayton@redhat.com>
CC: Shaggy <shaggy@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-04 20:05:09 +00:00
Steve French d12fd121af [CIFS] Cleanup formatting
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-03 19:43:19 +00:00
Shirish Pargaonkar d0d66c443a [CIFS] CIFS ACL support (part 2)
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-03 18:22:19 +00:00
Mariusz Kozlowski a8a11d399f [CIFS] remove some redundant argument checks
This patch does kmalloc + memset conversion to kzalloc and removes some
redundant argument checks.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-03 16:41:24 +00:00
Steve French 9b22b0b726 [CIFS] Reduce chance of list corruption in find_writable_file
When find_writable_file is racing with close and the session
to the server goes down, Shaggy noticed that there was a
chance that an open file in the list of files off the inode
could have been freed by close since cifs_reconnect can
block (the spinlock thus not held). This means that
we have to start over at the beginning of the list in some
cases.

There is a 2nd change that needs to be made later
(pointed out by Jeremy Allison and Shaggy) in order to
prevent cifs_close ever freeing the cifs per file info
when a write is pending.  Although we delay close from
freeing this memory for sufficiently long for all known
cases, ultimately on a very, very slow write
overlapping a close pending we need to allow close to return
(without freeing the cifs file info) and defer freeing the
memory to be the responsibility of the (sloooow) write
thread (presumably have to look at every place wrtPending
is decremented - and add a flag for deferred free for
after wrtPending goes to zero).

Acked-by: Shaggy <shaggy@us.ibm.com>
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-02 01:11:08 +00:00
Steve French 4084973dba [CIFS] change misleading field name
num_auth is really num_subauth in ACL terminology

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-10-01 19:59:01 +00:00
Steve French 92ad9b93cd [CIFS] named pipe support (part 2)
Also fixes typo which could cause build break

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-29 05:21:58 +00:00
Steve French 7f8ed420f8 [CIFS] CIFS support for named pipes (part 1)
This allows cifs to mount to ipc shares (IPC$)
which will allow user space applications to
layer over authenticated cifs connections
(useful for Wine and others that would want
to put DCE/RPC over CIFS or run CIFS named
pipes)

Acked-by: Rob Shearman <rob@codeweavers.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-28 22:28:55 +00:00
Steve French 407f61a2b4 [CIFS] Fix memory leak in statfs to very old servers
We were allocating request buffers twice in the statfs
path when mounted to very old (Windows 9x) servers.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-28 06:53:39 +00:00
Steve French 65874007c3 [CIFS] fix cut and paste error - missing defines cause cifsacl build error
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-25 19:53:44 +00:00
Steve French bcb020341a [CIFS] move cifs acl code to new file and fix build break
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-25 16:17:24 +00:00
Steve French 442aa310f3 [CIFS] Support for CIFS ACLs (part 1)
Add code to be able to dump CIFS ACL information
when Query Posix ACL with cifsacl mount parm enabled.

Signed-off-by: Shirish Pargoankar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-24 20:25:46 +00:00
Steve French 2224f4e5d5 [CIFS] fix typo in previous commit
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-20 15:37:29 +00:00
Steve French 1e71f25d14 [CIFS] Print better error when server returns malformed QueryUnixInfo response
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-20 15:30:07 +00:00
Steve French 5a44b3190e [CIFS] Add warning message when broken server fails SetFSInfo call
A reasonably common NAS server returns an error on the SetFSInfo of
the Unix capabilities. Log a message for this alerting the user
that the server may have problems with the Unix extensions,
and telling them what they can do to workaround it.

Unfortunately the server does not return other clues
that we could easily use to turn the Unix Extension support
off automatically in this case (since they claim to support it).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-20 15:16:24 +00:00
Steve French c45d707f67 [CIFS] Fallback to standard mkdir if server incorrectly claims support for
posix ops

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-17 02:04:21 +00:00
Steve French 5a07cdf86c [CIFS] fix small memory leak in an error path in new posix mkdir
There is a small memory leak in fs/cifs/inode.c::cifs_mkdir().
Storage for 'pInfo' is allocated with kzalloc(), but if the call
to CIFSPOSIXCreate(...) happens to return 0 and pInfo->Type == -1,
then we'll jump to the 'mkdir_get_info' label without freeing the
storage allocated for 'pInfo'.
This patch adds a kfree() call to free the storage just before
jumping to the label, thus getting rid of the leak.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-16 23:12:47 +00:00
Steve French a23d306981 [CIFS] missing field in debug output from previous fix
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-15 03:43:47 +00:00
Steve French 88f370a688 [CIFS] Fix potential NULL pointer usage if kzalloc fails
Potential problem was noticed by Cyrill Gorcunov

CC: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-15 03:01:17 +00:00
Steve French 638b250766 [CIFS] typo in earlier cifs_reconnect fix
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-15 02:35:51 +00:00
Jeff a8cd925f74 [CIFS] Respect umask when using POSIX mkdir
When making a directory with POSIX mkdir calls, cifs_mkdir does not
respect the umask.  This patch causes the new POSIX mkdir to create with
the right mode

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-13 18:38:50 +00:00
Steve French 4efa53f090 [CIFS] lock inode open file list in close in case racing with open
Harmless since it only protected turning off caching for the
inode, but cleaner to lock around this in case we have a close
racing with open.

Signed-off-by: Shaggy <shaggy@us.ibm.com>
CC: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-11 05:50:53 +00:00
Steve French 15745320f3 [CIFS] Fix oops in find_writable_file
There was a case in which find_writable_file was not waiting long enough
under heavy stress when writepages was racing with close of the file
handle being used by the write.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-09-07 22:23:48 +00:00
Steve French 77159b4df8 [CIFS] Fix warnings shown by newer version of sparse
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-31 01:10:17 +00:00
Steve French 26f57364d7 [CIFS] formatting cleanup found by checkpatch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-30 22:09:15 +00:00
Steve French f01d5e14e7 [CIFS] fix for incorrect session reconnects
cifs reconnect could end up happening incorrectly due to
the small initial tcp recvmsg response. When the socket
was within three bytes of being full and the recvmsg
returned only 1 to 3 bytes of the initial 4 byte
read of the RFC1001 length field. Fortunately this
seems to be less common on more current kernels, but
this fixes it so cifs tries to retrieve all 4 bytes
of the initial tcp read.

Signed-off-by: Shirish Pargoankar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-30 21:13:31 +00:00
Andre Haupt 8594c15ad2 [CIFS][KJ] use abs() from kernel.h where appropriate
Signed-off-by: Andrew Haupt <andre@finow14.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-30 20:18:41 +00:00
Steve French c19eb71020 [CIFS] fix typo in previous
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-24 03:22:48 +00:00
Jeff Layton 39db810cb6 [CIFS] Byte range unlock request to non-Unix server can unlock too much
On a mount without posix extensions enabled, when an unlock request is
made, the client can release more than is intended. To reproduce, on a
CIFS mount without posix extensions enabled:

1) open file
2) do fcntl lock: start=0 len=1
3) do fcntl lock: start=2 len=1
4) do fcntl unlock: start=0 len=1

...on the unlock call the client sends an unlock request to the server
for both locks. The problem is a bad test in cifs_lock.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-24 03:16:51 +00:00
Cyrill Gorcunov 95ba736210 [CIFS] Fix unbalanced call to GetXid/FreeXid
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-24 00:23:36 +00:00
Steve French 8064ab4da1 [CIFS] cifs truncate missing a fix for private map COW race
vmtruncate had added the same fix to handle the case of private pages
being Copy on writed while truncate_inode_pages is going on

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-22 22:12:07 +00:00
Cyrill Gorcunov 5e6e623275 [CIFS] Check return code on failed alloc
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-08-18 00:15:20 +00:00
Steve French a403a0a370 [CIFS] Fix hang in find_writable_file
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>
2007-07-26 15:54:16 +00:00
Paul Mundt 20c2df83d2 mm: Remove slab destructors from kmem_cache_create().
Slab destructors were no longer supported after Christoph's
c59def9f22 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 10:11:58 +09:00
Steve French 1ff8392c32 Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:

	fs/cifs/export.c
2007-07-19 00:38:57 +00:00
Steve French 70b315b0dd [CIFS] merge conflict in fs/cifs/export.c
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-19 00:32:25 +00:00
Steve French c18c842b1f [CIFS] Allow disabling CIFS Unix Extensions as mount option
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>
2007-07-18 23:21:09 +00:00
Steve French 63135e088a [CIFS] More whitespace/formatting fixes (noticed by checkpatch)
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-17 17:34:02 +00:00
Christoph Hellwig a569425512 knfsd: exportfs: add exportfs.h header
currently the export_operation structure and helpers related to it are in
fs.h.  fs.h is already far too large and there are very few places needing the
export bits, so split them off into a separate header.

[akpm@linux-foundation.org: fix cifs build]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:06 -07:00
Rafael J. Wysocki 8314418629 Freezer: make kernel threads nonfreezable by default
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves.  This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.

It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.

The patch causes all kernel threads to be nonfreezable by default (ie.  to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE.  It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear.  Additionally, it updates documentation to
describe the freezing of tasks more accurately.

[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:02 -07:00
Steve French 7e42ca886b [CIFS] Typo in previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-16 17:40:02 +00:00
Eric 6fa20d4fb5 [CIFS] zero_user_page() conversions
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-16 16:23:19 +00:00
Nate 8803863a90 [CIFS] use simple_prepare_write to zero page data
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>
2007-07-16 15:45:13 +00:00
Steve French 4a379e6657 [CIFS] Fix build break - inet.h not included when experimental ifdef off
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-15 21:58:28 +00:00
Steve French 2d785a50a8 [CIFS] Add support for new POSIX unlink
In the cleanup phase of the dbench test, we were noticing sharing
violation followed by failed directory removals when dbench
did not close the test files before the cleanup phase started.
Using the new POSIX unlink, which Samba has supported for a few
months, avoids this.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-15 01:48:57 +00:00
Steve French 50c2f75388 [CIFS] whitespace/formatting fixes
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>
2007-07-13 00:33:32 +00:00
Steve French 7521a3c566 [CIFS] Fix oops in cifs_create when nfsd server exports cifs mount
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>
2007-07-11 18:30:34 +00:00
Jens Axboe 5ffc4ef45b sendfile: remove .sendfile from filesystems that use generic_file_sendfile()
They can use generic_file_splice_read() instead. Since sys_sendfile() now
prefers that, there should be no change in behaviour.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-07-10 08:04:13 +02:00
Steve French fb8c4b14d9 [CIFS] whitespace cleanup
More than halfway there

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-10 01:16:18 +00:00
Steve French b609f06ac4 [CIFS] Fix packet signatures for NTLMv2 case
Signed-off-by: Yehuda Sadeh Weinraub <Yehuda.Sadeh@expand.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-09 07:55:14 +00:00
Steve French 3870253efb [CIFS] more whitespace fixes
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-08 15:40:40 +00:00
Steve French 790fe579f5 [CIFS] more whitespace cleanup
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-07 19:25:05 +00:00
Steve French 6dc0f87e35 [CIFS] whitespace cleanup
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-06 23:13:06 +00:00
Steve French 79a58d1f60 [CIFS] whitespace cleanup
checkpatch.pl redux

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-06 22:44:50 +00:00
Jeff d20acd09e3 [CIFS] ipv6 support no longer experimental
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-06 21:13:08 +00:00
Jeff 38c10a1ddb [CIFS] Mount should fail if server signing off but client mount option requires it
Currently, if mount with a signing-enabled sec= option (e.g.
sec=ntlmi), the kernel does a warning printk if the server doesn't
support signing, and then proceeds without signatures.

This is probably OK for people that think to look at the ring buffer,
but seems wrong to me. If someone explicitly requests signing, we
should error out if that request can't be satisfied. They can then
reattempt the mount without signing if that's ok.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-07-06 21:10:07 +00:00
Steve French d38d8c74c7 [CIFS] whitespace fixes
This changeset brought to you ... by patchcheck.pl

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-28 19:44:13 +00:00
Steve French 762e5ab77c [CIFS] Fix sign mount option and sign proc config setting
We were checking the wrong (old) global variable to determine
whether to override server and force signing on the SMB
connection.

Acked-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-28 18:41:42 +00:00
Steve French 467a8f8d48 [CIFS] whitespace cleanup
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-27 22:41:32 +00:00
Jeff 5d9c720678 [CIFS] Do not allow signals in cifs_demultiplex_thread
Switch from send_sig to force_sig and do not allow signal for this
background thread (the signal is needed to wakeup the thread when
blocked in the network stack).

Signed-off-by: Jeff Layton <jlayton@readhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-25 22:16:35 +00:00
Steve French ffdd6e4d16 [CIFS] fix whitespace
More whitespace problems found by checkpatch

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-24 21:15:44 +00:00
Steve French 75865f8cc8 [CIFS] Add in some missing flags and cifs README and TODO corrections
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-24 18:30:48 +00:00
Steve French 3ce53fc4c5 [CIFS] CIFS should honour umask
This patch makes CIFS honour a process' umask like other filesystems.
Of course the server is still free to munge the permissions if it wants
to; but the client will send the "right" permissions to begin with.

A few caveats:

1) It only applies to filesystems that have CAP_UNIX (aka support unix
extensions)
2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
after remote creation

When mode to CIFS/NTFS ACL mapping is complete we can do the
same thing for that case for servers which do not
support the Unix Extensions.

Signed-off-by: Matt Keenen <matt@opcode-solutions.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-08 14:55:14 +00:00
Yehuda Sadeh Weinraub 100c1ddc98 [CIFS] Missing flag on negprot needed for some servers to force packet signing
A related signature issue that I came across.
There's a bug in win2k that when NT error codes are not negotiated, the
server doesn't response that signatures are mandatory. Since there's
(currently) no way turn on signatures in such case, I had to force NT
error codes, so that this bug will not occur

Signed-off-by: Yehuda Sadeh Weinraub <Yehuda.Sadeh@expand.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-05 21:31:16 +00:00
Steve French 221601c3d1 [CIFS] whitespace cleanup part 2
Various coding style problems found by running the new
   checkpatch.pl script against fs/cifs.  3 more files
   fixed up.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-05 20:35:06 +00:00
Steve French 5fdae1f681 [CIFS] whitespace cleanup
Various coding style problems found by running fs/cifs
against the new checkpatch.pl script.  Since there
were too many to fit in one patch.  Updated the first
four files.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-05 18:30:44 +00:00
Akinobu Mita e6985c7f68 [CIFS] fix mempool destroy done in wrong order in cifs error path
Slab cache used as memory pool can not be destroyed before the memory
pool destruction. Because the memory pool still holds some objects and
kmem_cache_destroy() says "Can't free all objects".

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-06-04 16:14:59 +00:00
Steve French f7f7c31c98 [CIFS] typo in previous patch
(also fixed missing space after if)

Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-05-24 02:29:51 +00:00
Steve French 28356a1679 [CIFS] Fix oops on failed cifs mount (in kthread_stop)
If the cifs demultiplex thread wakes up and exits
(zeroing server->tsk) before kthread_stop is called, the
cifs_mount code could pass a null pointer to kthread_stop

Thanks to akpm, Dave Young and Shaggy for suggesting
earlier versions of this patch.

CC: akpm@linux-foundatior.org
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-05-23 14:45:36 +00:00
Christoph Lameter a35afb830f Remove SLAB_CTOR_CONSTRUCTOR
SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@ucw.cz>
Cc: David Chinner <dgc@sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-17 05:23:04 -07:00
Randy Dunlap e63340ae6b header cleaning: don't include smp_lock.h when not used
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>
2007-05-08 11:15:07 -07:00