Paul Mackerras [Mon, 23 Aug 2004 16:39:00 +0000 (09:39 -0700)]
[PATCH] ppc64: use struct list_head for hose_list
This patch changes hose_list from a simple linked list to a
"list.h"-style list. This is in preparation for the runtime
addition/removal of PCI Host Bridges.
Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nathan Fontenot [Mon, 23 Aug 2004 16:38:48 +0000 (09:38 -0700)]
[PATCH] ppc64: fix enable_surveillance() for power5
On some platforms (notably power5) you can't enable surveillance
(firmware/service processor watchdog) from the kernel - you have to do
it in the firmware.
This patch changes enable_surveillance() to make the message that is
printed in this situation more informative. Additionaly, the rtas_call
was changed to rtas_set_indicator so as to avoid having to handle
RTAS_BUSY returns.
Linus Torvalds [Mon, 23 Aug 2004 14:13:03 +0000 (07:13 -0700)]
Use F_SETLK instead of F_SETLK64 in nfs locking code.
The code doesn't actually _care_ about 32/64-bit issues,
only about F_SETLK vs F_SETLKW, and the F_SETLK64 doesn't
exist except as a compatibility thing on 64-bit architectures
(since the regular one already _is_ 64-bit, of course).
Trond Myklebust [Mon, 23 Aug 2004 16:02:36 +0000 (12:02 -0400)]
RPC,NFSv4: NFSv4 operations that create or destroy state on the
server are not allowed to be interrupted as that may result in the
client and server disagreeing.
Trond Myklebust [Mon, 23 Aug 2004 15:21:20 +0000 (11:21 -0400)]
NFSv2/v3/v4: Make the rpc_ops->getattr method take a filehandle
rather than an inode argument. Fix up nfs_instantiate() and
_nfs4_do_open to use this since doing a new lookup might be racy.
Trond Myklebust [Mon, 23 Aug 2004 15:19:03 +0000 (11:19 -0400)]
NFSv2/v3/v4: Place NFS nfs_page shared data into a single structure
that hangs off filp->private_data. As a side effect, this also
cleans up the NFSv4 private file state info.
Trond Myklebust [Mon, 23 Aug 2004 14:18:16 +0000 (10:18 -0400)]
NFSv2: In the NFSv3 RFC, the sattr3 structure passed in the SETATTR
call allows for the client to request that the mtime and/or atime
of an inode be set to the current server time, the given (client)
time, or not changed. The set-to-current-server value is used
when you run "touch file" on the client.
The NFSv2 RFC defines no such encoding for the sattr structure.
However Solaris and Irix machine obey a convention where passing
the invalid value mtime.useconds=1000000 means "set both mtime and
atime to the current server time". The convention is documented
in the book "NFS Illustrated" by Brent Callaghan. The patch below
implements this convention for the Linux client and server (hence
multiple To:s).
Trond Myklebust [Mon, 23 Aug 2004 14:17:20 +0000 (10:17 -0400)]
KCONFIG: In the kernel help for NFSv3 & NFSv4 client support both are
listed as "the newer version ... of the NFS protocol". Obviously
both can't be the newer version at the same time, so here's a
patch to correct the text in such a way that only v4 is listed as
the newer version. Patch is against 2.6.7-rc3 - please consider
including it.
Trond Myklebust [Mon, 23 Aug 2004 14:16:26 +0000 (10:16 -0400)]
NFS: Now that file handle comparison ignores the unused parts of the
file handle container, there is no longer any need to clear the
file handle container before copying in a file handle. This
allows us to remove a 128 byte memset() from several hot paths.
Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:15:49 +0000 (10:15 -0400)]
NFS: While the storage container for NFS file handles must be able to
store 128 bytes, usually NFS servers don't use file handles that
are more than 32 bytes in size. This patch creates an efficient
mechanism for comparing file handles that ignores the unused bytes
in a file handle.
Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:15:13 +0000 (10:15 -0400)]
NFS: In 2.4, NFS O_DIRECT used the VFS's O_DIRECT logic to provide
direct I/O support for NFS files. The 2.4 VFS O_DIRECT logic was
block based, thus the NFS client had to provide a minimum
allowable blocksize for O_DIRECT reads and writes on NFS files.
For various reasons we chose 512 bytes. In 2.6, there is no
requirement for a minimum blocksize. NFS O_DIRECT reads and
writes can go to any byte at any offset in a file. Thus we revert
the blocksize setting for NFS file systems to the previous
behavior, which was to advertise the "wsize" setting as the
optimal I/O block size. This improves the performance of
applications like 'cp' which use this value as their transfer
size.
This patch also exposes the server's reported disk block size in the
f_frsize of the vfsstat structure.
Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:13:19 +0000 (10:13 -0400)]
NFS: Break the nfs_wreq_lock into per-mount locks. This helps prevent
a heavy read and write workload on one mount point from
interfering with workloads on other mount points.
Note that there is still some serialization due to the big kernel
lock.
Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:12:24 +0000 (10:12 -0400)]
RPCSEC_GSS: Add the spkm3 common and client-side code.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:10:18 +0000 (10:10 -0400)]
NFSv4: OK, so it's trivial and probably superfluous, but I don't see
why we shouldn't be slightly stricter here, so I'm just going to
keep sending this until I'm told to stop.... Make sure that
unmapped errors are approximately in the range of defined NFS4
errors.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Trond Myklebust [Mon, 23 Aug 2004 14:01:57 +0000 (10:01 -0400)]
RPC: Reduce stack utilization for all synchronous NFS operations by
using a dynamically allocated rpc_task structure instead of
allocating one on the stack. This reduces stack utilization by
over 200 bytes for all synchronous NFS operations.
Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Linus Torvalds [Mon, 23 Aug 2004 10:59:22 +0000 (03:59 -0700)]
Remove pointless cast-as-lvalue usage from modedb.c
It's evil, people. Don't use that particular gcc extension.
I've yet to meet anybody who could read the resulting code
and tell me what the heck it does.
Linus Torvalds [Mon, 23 Aug 2004 10:10:29 +0000 (03:10 -0700)]
Don't use signed one-bit bitfields.
We assign 0 and 1 to it, but since it's signed, that's
actually already overflowing the poor thing. So make
it unsigned, which is what it really was supposed to be
in the first place.
David S. Miller [Mon, 23 Aug 2004 07:34:58 +0000 (00:34 -0700)]
[SPARC64]: Fix bugs in new U1memcpy code.
- U1copy_from_user needs PREAMBLE since it uses
explicit ASI_BLK_AIUS references.
- Need to use EX_RETVAL() in U1memcpy.S
- U1memcpy.S can load one 64-bit word too
many, passing the source buffer boundary
and thus potentially causing exceptions.
David S. Miller [Mon, 23 Aug 2004 07:33:47 +0000 (00:33 -0700)]
[SPARC64]: Revamped memcpy infrastructure.
- Make it easier to maintain the Ultra-I vs. Ultra-III
memcpy implementations. Before you had to maintain
3 different entire copies of the routines.
- Kill %asi register writing Ultra-I single memcpy loop
for both user and kernel. Was not worth it.
- Simplify exception detection and handling enormously.
Trond Myklebust [Mon, 23 Aug 2004 07:14:37 +0000 (00:14 -0700)]
[PATCH] Fix posix file locking (9/9)
NFSv2/v3: Fix up a race in the case where the user presses ^C while a
process is in the middle of setting up a posix lock. In case the
server registered our lock, we need to make sure that it gets
cleaned up during the resulting file close().
Trond Myklebust [Mon, 23 Aug 2004 07:14:14 +0000 (00:14 -0700)]
[PATCH] Fix posix file locking (7/9)
VFS,CIFS,NLM,NFSv4: make filesystems directly responsible for calling
posix_lock_file() if they need it. This fixes an NFS race whereby
in case of a server reboot, the recovery thread could re-establish
a lock that had just been freed.
Trond Myklebust [Mon, 23 Aug 2004 07:13:51 +0000 (00:13 -0700)]
[PATCH] Fix posix file locking (5/9)
NLM: file_lock->fl_owner may live for longer than the pid of the
original process that created it. Fix NFSv2/v3 client locking code
to map file_lock->fl_owner into a unique 32-bit number or
"pseudo-pid".
There's a misplaced check returning error for
hpt_minimum_revision(dev,8) == TRUE still there, making the previous
fixes useless for the early revision HPT cards.
Adrian Bunk [Mon, 23 Aug 2004 06:09:03 +0000 (23:09 -0700)]
[PATCH] cciss /proc dependency fix
cciss uses /proc to hook into the SCSI subsystem. If you do not build
/proc support into your kernel then you should also disable tape support in
the driver.
Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 23 Aug 2004 06:08:30 +0000 (23:08 -0700)]
[PATCH] cciss: pdev->intr fix
This patch fixes our usage of pdev->intr. We were truncating it to an unchar.
We were also reading it before calling pci_enable_device. This patch fixes
both of those. Thanks to Bjorn Helgaas for the patch.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 23 Aug 2004 06:07:44 +0000 (23:07 -0700)]
[PATCH] cciss: /proc fixes
This patch fixes our output in /proc to display the logical volume sizes and
RAID levels correctly. Without this patch RAID level will always be 0 and
size may be displayed as 0GB.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 23 Aug 2004 06:07:33 +0000 (23:07 -0700)]
[PATCH] cciss: zero out buffer in passthru ioctls for HP utilities
This patch addresses a problem with our utilities. We must zero out the
buffer before copying their data into it to prevent bogus info when switching
between SCSI & SATA or SAS drives.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Mon, 23 Aug 2004 06:07:10 +0000 (23:07 -0700)]
[PATCH] Fix gcc 3.5 compile issue in mm/mempolicy.c
Fix another gcc 3.5 compile issue, this time the default_policy prototype
was not marked static whereas the definition was. There is no need for
the prototype, so remove it.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rik van Riel [Mon, 23 Aug 2004 06:06:58 +0000 (23:06 -0700)]
[PATCH] increase per-user mlock limit default to 32k
Since various gnupg users have indicated that gpg wants to mlock 32kB of
memory, I created the patch below that increases the default mlock ulimit
to 32kB.
This is no security problem because it's trivial for processes to lock way
more memory than this in page tables, network buffers, etc. In fact, since
this patch allows gnupg to mlock to prevent passphrase data from being
swapped out, the security people will probably like it ;)
This gets the new per-user mlock limit a bit more testing, too.
Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rik van Riel [Mon, 23 Aug 2004 06:06:46 +0000 (23:06 -0700)]
[PATCH] rlimit-based mlocks for unprivileged users
Here is the last agreed-on patch that lets normal users mlock pages up to
their rlimit. This patch addresses all the issues brought up by Chris and
Andrea.
From: Chris Wright <chrisw@osdl.org>
Couple more nits.
The default lockable amount is one page now (first patch is was 0). Why
don't we keep it as 0, with the CAP_IPC_LOCK overrides in place? That way
nothing is changed from user perspective, and the rest of the policy can be
done by userspace as it should.
This patch breaks in one scenario. When ulimit == 0, process has
CAP_IPC_LOCK, and does SHM_LOCK. The subsequent unlock or destroy will
corrupt the locked_shm count.
It's also inconsistent in handling user_can_mlock/CAP_IPC_LOCK interaction
betwen shm_lock and shm_hugetlb.
SHM_HUGETLB can now only be done by the shm_group or CAP_IPC_LOCK.
Not any can_do_mlock() user.
Double check of can_do_mlock isn't needed in SHM_LOCK path.
Interface names user_can_mlock and user_substract_mlock could be better.
Incremental update below. Ran some simple sanity tests on this plus my
patch below and didn't find any problems.
* Make default RLIM_MEMLOCK limit 0.
* Move CAP_IPC_LOCK check into user_can_mlock to be consistent
and fix but with ulimit == 0 && CAP_IPC_LOCK with SHM_LOCK.
* Allow can_do_mlock() user to try SHM_HUGETLB setup.
* Remove unecessary extra can_do_mlock() test in shmem_lock().
* Rename user_can_mlock to user_shm_lock and user_subtract_mlock
to user_shm_unlock.
* Use user instead of current->user to fit in 80 cols on SHM_LOCK.
Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>