Moore, Eric [Wed, 18 Jan 2006 00:06:23 +0000 (17:06 -0700)]
[SCSI] fusion: unloading the driver results in panic - fix
The ioc->alt_ioc->alt_ioc pointer is not getting cleared
during driver unload time. This dangling pointer
can result in panic in certain circumstances, such
as error recovery, or firmware download in flashless
environments. This only impacts dual functions controllers,
such as 1030. Please apply.
This patch also includes a small cosmetic name change
for mpt_spi_log_info.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] mptsas: don't complain on bogus slave_alloc calls
When people use the userspace scanning facilities on SAS hardware the
LLDD gets bogus slave_alloc calls. Just fail those gracefully instead
of printing a warning in mptsas and another one in the midlayer.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
On Mon, Jan 16, 2006 at 06:53:24PM -0700, Moore, Eric wrote:
> Adding MSI support, and command line for enabling
> it. By default, the command line option has MSI disabled.
mpt_msi_enable is initialized to 0 implicitly, no need to do that. Also
replace if (mpt_msi_enable == 1) tests with just if (mpt_msi_enable).
Updated patch below:
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Moore, Eric [Tue, 17 Jan 2006 01:53:19 +0000 (18:53 -0700)]
[SCSI] fusion: add verbose messages for RAID actions
A customer request to send raid asyn actions
from firmware to the event syslog. This shows
when raid volumes go degraded, or complete resync,
or volumes created/deleted, etc.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] fusion: setting timeouts in eh threads appropiatley for fc/sas/spi
On Mon, Jan 16, 2006 at 06:53:13PM -0700, Moore, Eric wrote:
> The task managment request timeout in the eh threads was set
> for U320 timing, which is between 2-5 seconds.
> This is too small for FC and SAS.
> According to the firmware engineers, Fibre needs to be 40 seconds
> and SAS needs to be 10 seconds.
The timeout selection should probably be done in a little helper instead
of duplicated in a few places. Updated patch below.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Moore, Eric [Tue, 17 Jan 2006 01:53:06 +0000 (18:53 -0700)]
[SCSI] fusion: spi bus reset when driver loads
This patch is for spi. This issues bus reset when driver
loads. Handling cases when initator has negotiated for packetized,
and target negotiated for non-packetized; effectly this bus reset
is getting both target and initiator on the same sheet of music.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Hannes Reinecke [Mon, 30 Jan 2006 15:10:31 +0000 (16:10 +0100)]
[SCSI] aic79xx: Fix timer handling
Fix the timer handling in aic79xx to use the SCSI-ML provided handling
instead of implementing our own.
It also fixes a deadlock in the command recovery code.
Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Michael Reed [Thu, 26 Jan 2006 01:05:18 +0000 (18:05 -0700)]
[SCSI] fusion: FC rport code fixes
This fix's problems with recent fc submission regarding
i/o being redirected to the wrong target.
Signed-off-by: Michael Reed <mdr@sgi.com> Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Moore, Eric [Thu, 26 Jan 2006 23:20:06 +0000 (16:20 -0700)]
[SCSI] fusion: add support for raid hot add/del support
RAID event support.
This will hot add and remove raid volumes
when managment application creates and
deletes the volumes. The driver is basically
responding to firmware asyn events, and reporting
the changes to the above layers.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Sumant Patro [Wed, 25 Jan 2006 20:02:40 +0000 (12:02 -0800)]
[SCSI] megaraid_sas: new template defined to represent each type of controllers
This patch defines a new template to represent each type of
controllers (identified by the processor used). The template has
members that is set with appropriate values during driver
initialisation. This change is done to support new controllers with
minimal change to existing code. In future, for a new controller
support, a template will be declared and its members initialised
appropriately.
Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Rejections fixed and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Sumant Patro [Wed, 25 Jan 2006 19:53:25 +0000 (11:53 -0800)]
[SCSI] megaraid_sas: cleanup queue command path
This patch (originally submitted by Christoph Hellwig) removes code
duplication in megasas_build_cmd. It also defines
MEGASAS_IOC_FIRMWARE32 to allow 64 bit compiled applications to work.
Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Rejections fixed and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] Prevent scsi_execute_async from guessing cdb length
When the scsi_execute_async interface was added it ended up reducing
the flexibility of userspace to send arbitrary scsi commands through
sg using SG_IO. The SG_IO interface allows userspace to specify the
CDB length. This is now ignored in scsi_execute_async and it is
guessed using the COMMAND_SIZE macro, which is not always correct,
particularly for vendor specific commands. This patch adds a cmd_len
parameter to the scsi_execute_async interface to allow the caller
to specify the length of the CDB.
Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Jack Hammer [Tue, 24 Jan 2006 19:43:41 +0000 (14:43 -0500)]
[SCSI] ips soft lockup during reset/initialization
Resetting the adapter causes the ServeRAID driver to exceed
the max time allowed by the softlock watchdog. Resetting the
hardware can easily require 30 or more seconds. To avoid the
"BUG: soft lockup detected on CPU#0!"
result, this patch replaces the mdelay() calls in the
initialization/reset routines with msleep().
Signed-off-by: Jack Hammer <jack_hammer@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] qla2xxx: Drop legacy 'bypass lun scan for tape device' code.
Internal lun discovery has been removed since fc_transport
integration. Short-circuiting for tape-devices in
qla2x00_update_fcport() could inadvertently result in a
blocked rport timing-out and its targets being reaped.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] qla2xxx: Correct issue where the rport's upcall was not being made after relogin.
A target can LOGO an initiator at any time (i.e. during I/O,
due to a controller hicup, or as a simple authentication
mechanism after an initial CDB command), when this occurs,
the driver attempts to relogin (PLOGI) to the device via the
DPC thread. Add code to make the appropriate upcall to the
FC transport layer (fc_remote_port_add()) upon successful
completion of the PLOGI.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] qla2xxx: Correct synchronization issues during rport addition/deletion.
The driver can typically detect port-loss during an
interrupt context (i.e. via interrogation of a status IOCB's
completion status [CS_PORT_LOGGED_OUT]. Due to the calling
requirements of the fc_rport APIs, the driver would defer
removal of the device to the default workqueue. If the
work-item was preceded by an event which caused the port to
obtain visibility (relogin successful, target re-logged into
the topology), deferred removal could inadvertently drop the
rport. The code also no longer defers removal via the
default workqueue, instead opting for use of the driver's
own DPC thread.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
[SCSI] dc395x: "fix" virt_addr calculation on AUTO_REQSENSE
The patch below "fixes" calculation of the virt_addr for the AUTO_REQSENSE
case. I put "fixes" in quotes because the real fix would be to completely
remove it, but that's beyond the scope of this patch.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
New versions of the Power5 firmware can send a "re-enable" message to
the virtual scsi adapter. This fix makes us handle the message
correctly. Without it, the driver goes catatonic and the system crashes
unpleasantly.
Signed-off-by: Dave Boutcher <sleddog@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
are busted. This is most easily seen with an X application
that uses sub-second select/poll timeout such as emacs. You
hit a key and it takes a second or so before the app responds.
The two ROUND_UP() calls upon entry are using {tv,ts}_sec where it
should instead be using {tv_usec,ts_nsec}, which perfectly explains
the observed incorrect behavior.
Another bug shot down with git bisect.
Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
John Hawkes [Thu, 19 Jan 2006 07:46:53 +0000 (23:46 -0800)]
[IA64] eliminate softlockup warning
Fix an unnecessary softlockup watchdog warning in the ia64
uncached_build_memmap() that occurs occasionally at 256p and always at
512p. The problem occurs at boot time.
Signed-off-by: John Hawkes <hawkes@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Alan Cox [Thu, 19 Jan 2006 01:44:13 +0000 (17:44 -0800)]
[PATCH] EDAC: core EDAC support code
This is a subset of the bluesmoke project core code, stripped of the NMI work
which isn't ready to merge and some of the "interesting" proc functionality
that needs reworking or just has no place in kernel. It requires no core
kernel changes except the added scrub functions already posted.
The goal is to merge further functionality only after the core code is
accepted and proven in the base kernel, and only at the point the upstream
extras are really ready to merge.
From: doug thompson <norsk5@xmission.com>
This converts EDAC to sysfs and is the final chunk neccessary before EDAC
has a stable user space API and can be considered for submission into the
base kernel.
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: doug thompson <norsk5@xmission.com> Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox [Thu, 19 Jan 2006 01:44:07 +0000 (17:44 -0800)]
[PATCH] EDAC: atomic scrub operations
EDAC requires a way to scrub memory if an ECC error is found and the chipset
does not do the work automatically. That means rewriting memory locations
atomically with respect to all CPUs _and_ bus masters. That means we can't
use atomic_add(foo, 0) as it gets optimised for non-SMP
This adds a function to include/asm-foo/atomic.h for the platforms currently
supported which implements a scrub of a mapped block.
It also adjusts a few other files include order where atomic.h is included
before types.h as this now causes an error as atomic_scrub uses u32.
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Woodhouse [Thu, 19 Jan 2006 01:44:05 +0000 (17:44 -0800)]
[PATCH] Add pselect/ppoll system call implementation
The following implementation of ppoll() and pselect() system calls
depends on the architecture providing a TIF_RESTORE_SIGMASK flag in the
thread_info.
These system calls have to change the signal mask during their
operation, and signal handlers must be invoked using the new, temporary
signal mask. The old signal mask must be restored either upon successful
exit from the system call, or upon returning from the invoked signal
handler if the system call is interrupted. We can't simply restore the
original signal mask and return to userspace, since the restored signal
mask may actually block the signal which interrupted the system call.
The TIF_RESTORE_SIGMASK flag deals with this by causing the syscall exit
path to trap into do_signal() just as TIF_SIGPENDING does, and by
causing do_signal() to use the saved signal mask instead of the current
signal mask when setting up the stack frame for the signal handler -- or
by causing do_signal() to simply restore the saved signal mask in the
case where there is no handler to be invoked.
The first patch implements the sys_pselect() and sys_ppoll() system
calls, which are present only if TIF_RESTORE_SIGMASK is defined. That
#ifdef should go away in time when all architectures have implemented
it. The second patch implements TIF_RESTORE_SIGMASK for the PowerPC
kernel (in the -mm tree), and the third patch then removes the
arch-specific implementations of sys_rt_sigsuspend() and replaces them
with generic versions using the same trick.
The fourth and fifth patches, provided by David Howells, implement
TIF_RESTORE_SIGMASK for FR-V and i386 respectively, and the sixth patch
adds the syscalls to the i386 syscall table.
This patch:
Add the pselect() and ppoll() system calls, providing core routines usable by
the original select() and poll() system calls and also the new calls (with
their semantics w.r.t timeouts).
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Cc: Michael Kerrisk <mtk-manpages@gmx.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Thu, 19 Jan 2006 01:44:02 +0000 (17:44 -0800)]
[PATCH] uml: add TIF_RESTORE_SIGMASK support
Add support for TIF_RESTORE_SIGMASK. I copy the i386 handling of the flag.
sys_sigsuspend is also changed to follow i386.
Also a bit of cleanup -
turn an if into a switch
get rid of a couple more emacs formatting comments
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Woodhouse [Thu, 19 Jan 2006 01:44:01 +0000 (17:44 -0800)]
[PATCH] TIF_RESTORE_SIGMASK support for arch/powerpc
Implement the TIF_RESTORE_SIGMASK flag in the new arch/powerpc kernel, for
both 32-bit and 64-bit system call paths.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Howells [Thu, 19 Jan 2006 01:44:00 +0000 (17:44 -0800)]
[PATCH] Handle TIF_RESTORE_SIGMASK for i386
Handle TIF_RESTORE_SIGMASK as added by David Woodhouse's patch entitled:
[PATCH] 2/3 Add TIF_RESTORE_SIGMASK support for arch/powerpc
[PATCH] 3/3 Generic sys_rt_sigsuspend
It does the following:
(1) Declares TIF_RESTORE_SIGMASK for i386.
(2) Invokes it over to do_signal() when TIF_RESTORE_SIGMASK is set.
(3) Makes do_signal() support TIF_RESTORE_SIGMASK, using the signal mask saved
in current->saved_sigmask.
(4) Discards sys_rt_sigsuspend() from the arch, using the generic one instead.
(5) Makes sys_sigsuspend() save the signal mask and set TIF_RESTORE_SIGMASK
rather than attempting to fudge the return registers.
(6) Makes sys_sigsuspend() return -ERESTARTNOHAND rather than looping
intrinsically.
(7) Makes setup_frame(), setup_rt_frame() and handle_signal() return 0 or
-EFAULT rather than true/false to be consistent with the rest of the
kernel.
Due to the fact do_signal() is then only called from one place:
(8) Makes do_signal() no longer have a return value is it was just being
ignored; force_sig() takes care of this.
(9) Discards the old sigmask argument to do_signal() as it's no longer
necessary.
(10) Makes do_signal() static.
(11) Marks the second argument to do_notify_resume() as unused. The unused
argument should remain in the middle as the arguments are passed in as
registers, and the ordering is specific in entry.S
Given the way do_signal() is now no longer called from sys_{,rt_}sigsuspend(),
they no longer need access to the exception frame, and so can just take
arguments normally.
This patch depends on sys_rt_sigsuspend patch.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Woodhouse [Thu, 19 Jan 2006 01:43:57 +0000 (17:43 -0800)]
[PATCH] Generic sys_rt_sigsuspend()
The TIF_RESTORE_SIGMASK flag allows us to have a generic implementation of
sys_rt_sigsuspend() instead of duplicating it for each architecture. This
provides such an implementation and makes arch/powerpc use it.
It also tidies up the ppc32 sys_sigsuspend() to use TIF_RESTORE_SIGMASK.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ulrich Drepper [Thu, 19 Jan 2006 01:43:53 +0000 (17:43 -0800)]
[PATCH] vfs: *at functions: core
Here is a series of patches which introduce in total 13 new system calls
which take a file descriptor/filename pair instead of a single file
name. These functions, openat etc, have been discussed on numerous
occasions. They are needed to implement race-free filesystem traversal,
they are necessary to implement a virtual per-thread current working
directory (think multi-threaded backup software), etc.
We have in glibc today implementations of the interfaces which use the
/proc/self/fd magic. But this code is rather expensive. Here are some
results (similar to what Jim Meyering posted before).
The test creates a deep directory hierarchy on a tmpfs filesystem. Then
rm -fr is used to remove all directories. Without syscall support I get
this:
real 0m31.921s
user 0m0.688s
sys 0m31.234s
With syscall support the results are much better:
real 0m20.699s
user 0m0.536s
sys 0m20.149s
The interfaces are for obvious reasons currently not much used. But they'll
be used. coreutils (and Jeff's posixutils) are already using them.
Furthermore, code like ftw/fts in libc (maybe even glob) will also start using
them. I expect a patch to make follow soon. Every program which is walking
the filesystem tree will benefit.
Signed-off-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@ftp.linux.org.uk> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Michael Kerrisk <mtk-manpages@gmx.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
find_exported_dentry contains two duplicate loops to find an alias that the
acceptable callback likes. Split this out to a new helper and switch from
list_for_each to list_for_each_entry to make it more readable.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Shaw [Thu, 19 Jan 2006 01:43:51 +0000 (17:43 -0800)]
[PATCH] knfsd: Provide missing NFSv2 part of patch for checking vfs_getattr.
A recent patch which checked the return status of vfs_getattr in nfsd,
completely missed the nfsproc.c (NFSv2) part. Here is it.
This patch moved the call to vfs_getattr from the xdr encoding (at which point
it is too late to return an error) to the call handling. This means several
calls to vfs_getattr are needed in nfsproc.c. Many are encapsulated in
nfsd_return_attrs and nfsd_return_dirop.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Al Viro [Thu, 19 Jan 2006 01:43:48 +0000 (17:43 -0800)]
[PATCH] nfsd4_lock() returns bogus values to clients
missing nfserrno() in default case of a switch by return value of
posix_lock_file(); as the result we send negative host-endian to clients that
expect positive network-endian, preferably mentioned in RFC... BTW, that case
is not impossible - posix_lock_file() can return -ENOLCK and we do not handle
that one explicitly.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Al Viro [Thu, 19 Jan 2006 01:43:47 +0000 (17:43 -0800)]
[PATCH] NFSERR_SERVERFAULT returned host-endian
->rp_status is network-endian and nobody byteswaps it before sending to
client; putting NFSERR_SERVERFAULT instead of nfserr_serverfault in there is
not nice...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Al Viro [Thu, 19 Jan 2006 01:43:46 +0000 (17:43 -0800)]
[PATCH] nfsd4_truncate() bogus return value
-EINVAL (in host order, no less) is not a good thing to return to client.
nfsd4_truncate() returns it in one case and its callers expect nfs_.... from
it. AFAICS, it should be nfserr_inval
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Al Viro [Thu, 19 Jan 2006 01:43:44 +0000 (17:43 -0800)]
[PATCH] nfsd/vfs.c: endianness fixes
Several failure exits return -E<something> instead of nfserr_<something> and
vice versa.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Fred Isaman [Thu, 19 Jan 2006 01:43:43 +0000 (17:43 -0800)]
[PATCH] nfsd4: clean up settattr code
Clean up some unnecessary special-casing in the setattr code..
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Fred Isaman [Thu, 19 Jan 2006 01:43:40 +0000 (17:43 -0800)]
[PATCH] nfsd4: Fix bug in rdattr_error return
Fix bug in rdattr_error return which causes correct error code to be
overwritten by nfserr_toosmall.
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:38 +0000 (17:43 -0800)]
[PATCH] nfsd4: fix open_downgrade
Bad bookkeeping of the share reservations when handling open upgrades was
causing open downgrade to fail.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:36 +0000 (17:43 -0800)]
[PATCH] nfsd4: don't create on open that fails due to ERR_GRACE
In an earlier patch (commit b648330a1d741d5df8a5076b2a0a2519c69c8f41) I noted
that a too-early grace-period check was preventing us from bumping the
sequence id on open. Unfortunately in that patch I stupidly moved the
grace-period check back too far, so now an open for create can succesfully
create the file while still returning ERR_GRACE.
The correct place for that check is after we've set the open_owner and handled
any replays, but before we actually start mucking with the filesystem.
Thanks to Avishay Traeger for reporting the bug.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:34 +0000 (17:43 -0800)]
[PATCH] nfsd4: simplify process-open1 logic
nfsd4_process_open1 is very highly nested; flatten it out a bit.
Also, the preceding comment, which just outlines the logic, seems redundant.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Remove some goto's that made the logic here a little more tortuous than
necessary.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:32 +0000 (17:43 -0800)]
[PATCH] nfsd4: no replays on unconfirmed owners
We shouldn't check for replays until after checking whether the open owner is
confirmed. Clients are allowed to reuse openowners without bumping the seqid.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:30 +0000 (17:43 -0800)]
[PATCH] nfsd4: handle replays of failed open reclaims
We need to make sure open reclaims are marked confirmed immediately so that we
can handle replays even if they fail (e.g. with a seqid-incrementing error).
(See 8.1.8.)
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:29 +0000 (17:43 -0800)]
[PATCH] nfsd4: recovery lookup dir check
Make sure we get a directory when we look up the recovery directory.
Thanks to Christoph Hellwig for the bug report.
Based on feedback from Christoph and others, we may remove the need for this
lookup and just pass in a file descriptor from userspace instead, and/or
completely move the directory handling to userspace. For now we're just
fixing the obvious bugs.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:27 +0000 (17:43 -0800)]
[PATCH] nfsd4: fix open of recovery directory
We should be opening this directory RDONLY, not RDWR.
Thanks to Christoph Hellwig for the bug report.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Allow mechanisms to return more varied errors on the context creation
downcall.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Kevin Coffman [Thu, 19 Jan 2006 01:43:25 +0000 (17:43 -0800)]
[PATCH] svcrpc: gss: server context init failure handling
We require the server's gssd to create a completed context before asking the
kernel to send a final context init reply. However, gssd could be buggy, or
under some bizarre circumstances we might purge the context from our cache
before we get the chance to use it here.
Handle this case by returning GSS_S_NO_CONTEXT to the client.
Also move the relevant code here to a separate function rather than nesting
excessively.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andy Adamson [Thu, 19 Jan 2006 01:43:24 +0000 (17:43 -0800)]
[PATCH] svcrpc: gss: handle the GSS_S_CONTINUE
Kerberos context initiation is handled in a single round trip, but other
mechanisms (including spkm3) may require more, so we need to handle the
GSS_S_CONTINUE case in svcauth_gss_accept. Send a null verifier.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:23 +0000 (17:43 -0800)]
[PATCH] nfsd4: operation debugging
Simple, useful debugging printk: print the number of each op as we process it.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:22 +0000 (17:43 -0800)]
[PATCH] nfsd4: fix check_for_locks
Fix some bad logic.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:21 +0000 (17:43 -0800)]
[PATCH] nfsd4: remove release_state_owner()
It's confusing having both release_stateowner() and release_state_owner().
And as it turns out, release_state_owner() is short and only called from one
place; so just remove it.
Also note the confirmed check is superfluous there--preprocess_seqid_op
already check this.
And remove a redundant comment and a superfluous line assignment while we're
at it.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:19 +0000 (17:43 -0800)]
[PATCH] nfsd4: rename lk_stateowner
One of the things that's confusing about nfsd4_lock is that the lk_stateowner
field could be set to either of two different lockowners: the open owner or
the lock owner. Rename to lk_replay_owner and add a comment to make it clear
that it's used for whichever stateowner has its sequence id bumped for replay
detection.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:18 +0000 (17:43 -0800)]
[PATCH] nfsd4: fix nfsd4_lock cleanup on failure
release_state_owner also puts the lock owner on the close_lru. There's no
need for that, though; replays of the failed lock would be handled by the
openowner not the lockowner.
Also consolidate the cleanup a bit, fixing leaks that can happen if errors
occur between the time a new lock owner is allocated and the lock is done.
Remove a comment and dprintk that look a little redundant.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andy Adamson [Thu, 19 Jan 2006 01:43:17 +0000 (17:43 -0800)]
[PATCH] nfsd4: misc lock fixes
Logic fixes for LOCK and UNLOCK.
- Move the permission check on the current file handle outside of
nfs4_lock_state()
- remove the file manager fl_release_private calls; fl_ops is not set.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
J. Bruce Fields [Thu, 19 Jan 2006 01:43:16 +0000 (17:43 -0800)]
[PATCH] svcrpc: save and restore the daddr field when request deferred
The server code currently keeps track of the destination address on every
request so that it can reply using the same address. However we forget to do
that in the case of a deferred request. Remedy this oversight. >From folks
at PolyServe.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NeilBrown [Thu, 19 Jan 2006 01:43:14 +0000 (17:43 -0800)]
[PATCH] nfsd: remove inline from a couple of large NFS functions
These are both called from two places close together. I could rearrange that
code so there is only one call site, but just removing the 'inline' is
probably best.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
YAMAMOTO Takashi [Thu, 19 Jan 2006 01:43:13 +0000 (17:43 -0800)]
[PATCH] nfsd: check error status from nfsd_sync_dir
Change nfsd_sync_dir to return an error if ->sync fails, and pass that error
up through the stack. This involves a number of rearrangements of error
paths, and care to distinguish between Linux -errno numbers and NFSERR
numbers.
In the 'create' routines, we continue with the 'setattr' even if a previous
sync_dir failed.
This patch is quite different from Takashi's in a few ways, but there is still
a strong lineage.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roman Zippel [Thu, 19 Jan 2006 01:43:10 +0000 (17:43 -0800)]
[PATCH] hfs: set correct create date for links
HFS+ also requires the correct creation date so recent version of OS X
recognize it as link.
Improve link handling:
- if something is wrong with the link, ignore the link attribute and treat
it as regular file (this also fixes a missing unlock during lookup).
- check for incorrect link counts during unlink.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roman Zippel [Thu, 19 Jan 2006 01:43:09 +0000 (17:43 -0800)]
[PATCH] hfs: set correct ctime
Read the correct ctime from disk (it was written but never read for some
reason). Read also creation date, which is used in the next patch. (Problem
found by Olivier Castan <olivier.castan@certa.ssi.gouv.fr>)
Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roman Zippel [Thu, 19 Jan 2006 01:43:05 +0000 (17:43 -0800)]
[PATCH] hfs: cleanup HFS+ prints
Add the log level and a "hfs: " prefix to all kernel prints. (HFS and HFS+
will use the same prefix, as they share some code and could be merged at some
point.)
Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jason Baron [Thu, 19 Jan 2006 01:43:03 +0000 (17:43 -0800)]
[PATCH] fix sched_setscheduler semantics
Currently, a negative policy argument passed into the
'sys_sched_setscheduler()' system call, will return with success. However,
the manpage for 'sys_sched_setscheduler' says:
EINVAL The scheduling policy is not one of the recognized policies, or the
parameter p does not make sense for the policy.
Signed-off-by: Jason Baron <jbaron@redhat.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
v9fs mmap support was originally removed from v9fs at Al Viro's request,
but recently there have been requests from folks who want readpage
functionality (primarily to enable execution of files mounted via 9P).
This patch adds readpage support (but not writepage which contained most of
the objectionable code). It passes fsx-linux (and other regressions) so it
should be relatively safe.
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>