Hisashi Hifumi [Tue, 11 Jan 2005 11:30:37 +0000 (03:30 -0800)]
[PATCH] BUG on error handlings in Ext3 under I/O failure condition
I found bugs on error handlings in the functions arround the ext3 file
system, which cause inadequate completions of synchronous write I/O
operations when disk I/O failures occur. Both 2.4 and 2.6 have this
problem.
I carried out following experiment:
1. Mount a ext3 file system on a SCSI disk with ordered mode.
2. Open a file on the file system with O_SYNC|O_RDWR|O_TRUNC|O_CREAT flag.
3. Write 512 bytes data to the file by calling write() every 5 seconds, and
examine return values from the syscall.
from write().
4. Disconnect the SCSI cable, and examine messages from the kernel.
After the SCSI cable is disconnected, write() must fail. But the result
was different: write() succeeded for a while even though messages of the
kernel notified SCSI I/O error.
By applying following modifications, the above problem was solved.
[PATCH] pcmcia: yenta override to re-allocate resources
From: Manfred Spraul
One bios assigns a small window for i/o access to yenta bridges. But there
are Cardbus cards that needs lots of i/o ports. yenta usually honors the bios
selected values, except if the bios choice is clearly invalid. The patch
allows an override from the command line.
Move the resource databases and the "mem_probe" flag into a struct
specific to rsrc_nonstatic, as it is not needed for the SS_CAP_STATIC_MAP
case. Saves a few bytes, and makes code clearer (in my opinion)
[PATCH] pcmcia: validate_mem only for non-statically mapped sockets
validate_mem() does only make sense for !SS_CAP_STATIC_MAP sockets. Therefore,
re-direct validate_mem() calls only for those. The newly added redirection
layer will allow for a "library" module named "rsrc_nonstatic" which contains
the resource database handling code, and it will only need to be loaded for
the drivers which need it.
Make the io and mem db per-socket, as different sockets may have different
requirements or may not even need the resource db at all (SS_CAP_STATIC_MAP).
Updated to make rsrc_mem_probe per-socket and to remove unnecessary and even
broken check for empty list as per Russell King's suggestions.
[PATCH] pcmcia: remove mtd and bulkmem (replaced by pcmciamtd)
Instead of "memory_cs", BIND_MTD, {FIRST,NEXT}_REGION, 2.6. kernels
use the "pcmciamtd" driver which doesn't need these functions. Cardmgr
still calls it in default configuration, so warn the user about changes
necessary to /etc/pcmcia/config , and remove the now unused code.
Remove the "Attributes" entry of struct client_t -- _all_ in-kernel drivers
did set it to INFO_IO_CLIENT | INFO_CARD_SHARE anyway, and the pcmcia core
didn't care at all what this value was set to.
Also, remove the setting of the respective request field in all in-kernel
drivers -- the request structure is kept the same, though, to keep external
drivers compiling.
Hirofumi Ogawa [Tue, 11 Jan 2005 11:25:18 +0000 (03:25 -0800)]
[PATCH] pcmcia: Add disable_clkrun option
I received report that transmission of Realtek 8139 doesn't work. The
cause of this problem was CLKRUN protocols of laptop's TI 12xx CardBus
bridge.
CLKRUN is used for controlling the PCI clock by PCI devices (for power saving).
If device has bug, probably it becomes the cause of stopping the PCI clock at
an unexpected timing.
In the problem of realtek 8139 case, the TX packet which the driver set to the
device was not sent out (still pending state in device).
If "disable_clkrun" is enabled, the problem of TX stopped occurring. So, I
thought the cause is CLKRUN, and is hardware bug of Cardbus or realtek 8139.
(8139 seems only can control by rewriting EEPROM)
And looks like also
http://support.microsoft.com/default.aspx?scid=kb;en-us;q294465
http://support.microsoft.com/default.aspx?scid=kb;en-us;182591
has the problem of CLKRUN.
And I remember that this problem had happened on Thinkpad before. In the
case, problem seems solved by similar workaround of sound/oss/cs46xx.c.
This patch adds "disable_clkrun" option as workaround of problem to
yenta_socket.
[PATCH] pcmcia: SET_NETDEV for wireless network devices
This patch updates pcmcia wireless drivers so that their class devices are
linked to the correct physical device. Based on an patch by Adam Belay, but
adapted to a different pcmcia driver model implementation.
This patch updates pcmcia network drivers so that their class devices are
linked to the correct physical device. Based on an patch by Adam Belay, but
adapted to a different pcmcia driver model implementation.
Move the struct client_t inside struct pcmcia_device. This means it gets
proper reference counting as well. The clients list inside struct
pcmcia_socket can be removed now.
All in-kernel PCMCIA devices do unregister their client in their respective
->detach() function after a REMOVAL event. So, AFAICS, the dev_list iteration
should always be false.
Restructure unbind_request():
Before, unbind_request was called by cardmgr on the following occasions:
a) if the CS_EVENT_CARD_INSERTION event failed
b) during do_remove(), which is called on
1) when cardmgr is informed of a CS_EVENT_CARD_REMOVAL event
2) when cardmgr is informed of a CS_EVENT_EJECTION_REQUEST event, if
do_check() succeeds
3) cardmgr exit (SIGINT/SIGTERM), if do_check() succeeds
We can ignore a), as the user is informed of the problem anyway, and can
take appropriate action then (eject the card, update config, write new driver,
insert card...).
b1) can be done directly, even before the userspace cardmgr is informed.
This speeds up the call to ->detach().
b2) All drivers I checked were based on the assumption that a
CS_EVENT_CARD_REMOVAL event is received _first_, before a call to
->detach(). Most notably, some drivers issue first a call to their
release() function [which else is called during EVENT_CARD_REMOVAL] during
->detach() if it hasn't been issued before. So, it doesn't hurt if unbind
is only called during the EVENT_CARD_REMOVAL step, and not during
EJECTION_REQUEST. The REMOVAL step is only called anyway if
EJECTION_REQUEST succeeds, and the latter can only succeed if do_check()
succeeds.
b3) If cardmgr exits from daemon mode, ds_release() is called. I can't
see a reason why this is good behaviour, especially as cards don't need
cardmgr while running, only for setup.
Consequences:
- call unbind_request during CARD_REMOVAL handling, even before userspace
is informed.
- return "0" if UNBIND_REQUEST is called from userspace.
- the driver's event handler is called with CARD_REMOVAL _always_ before
->detach() is called.
Use a struct pcmcia_device-based approach to inform "clients" of events. It
needs to be done using bus_for_each_device() so that we don't need to take the
device_list spinlock.
[PATCH] pcmcia: get a reference to ds-socket for each pcmcia_device
Obtain a reference to struct pcmcia_bus_socket for each pcmcia_device. This
means that pcmcia_device always holds an indirect reference to struct
pcmcia_socket as well.
[PATCH] pcmcia: use kref instead of native atomic counter
Switch pcmcia_bus_socket's reference counting to struct kref. Also, split the
access by number into two calls, so that get_bus_socket can be used in a more
generic way.
[PATCH] pcmcia: device model integration can only be submitted under GPL, part 2
As discussed previously, my integration of ds.c and cs.c with the driver model
can and will only be available under the GPL, as it's too much derived of
other buses' implementation of integration with the driver model.
cs_internal.h did only contain the MPL header before - I contacted Dave Hinds
because of this, and as far as he can tell, it was just an oversight that this
was not marked as dual-licensed as the other files are.
[PATCH] pcmcia: move pcmcia_(un,)register_client to ds
Move pcmcia_{de,}register_client() from cs.c to ds.c, and remove the unused
pcmcia_get_{first,next}_client() calls -- they would be an unnecessary hassle
to deal with in the next patches.
[PATCH] pcmcia: remove internal module use count, use module_refcount instead
Remove the internal driver use_count in ds.c, as the reference counting is
done in the module core anyways, and that reference count is available for
cardmgr's usage by a call to module_refcount. And if !CONFIG_MODULE_UNLOAD,
rmmod is useless anyways, so avoid that call by cardmgr at all.
[PATCH] pcmcia: remove socket_bind_t, use pcmcia_devices instead
Remove struct socket_bind_t by moving "dev_link_t *instance" to struct
pcmcia_device, and transforming all users of socket_bind_t to use struct
pcmcia_device instead. Also, CodingStyle updates for get_device_info and
unbind_request.
[PATCH] pcmcia: device model integration can only be submitted under GPL
As discussed previously, my integration of ds.c with the driver model
can and will only be available under the GPL, as it's too much
derived of other buses' implementation of integration with the driver model.
[PATCH] pcmcia: call device drivers from ds, not from cs
Call the PCMCIA 16-bit device drivers from ds.c instead of cs.c. Also,
remove the delayed handling of CS_REMOVAL events, but keep the ordering
the same as it used to be due to the delay.
Add a new registration function to register the PCMCIA 16-bit subsystem
(ds a.k.a. pcmcia) with the PCMICA core (cs a.k.a. pcmcia_core).
As send_event is only called with skt->sem held, we can use that to safeguard
skt->callback(), too. Note that the class_device_register() call by pccardd()
is done _before_ skt->sem() is held, and the pcmcia_socket_register() doesn't
hold skt->sem() as well, so there is no chance for a deadlock.
Since the big direct I/O rework do_truncate takes i_alloc_sem before
calling into ->setattr. Unfortunately the other callers of ->setattr with
ATTR_SIZE, most notably nfsd don't take it.
The (out of tree) XFS dmapi code relies wants to release i_alloc_sem and
thus gets into problems like
http://oss.sgi.com/bugzilla/show_bug.cgi?id=365
This patch moves acquiring and releasing i_alloc_sem into notify_change()
to make the locking behaviour consistant.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Prasanna Meda [Tue, 11 Jan 2005 11:18:08 +0000 (03:18 -0800)]
[PATCH] easily tweakable comm length
This change still keeps the comm length at 16, but allows easier patching
for local modifications, and also introduces a macro to use instead of
magic 16, where sizeof(comm) is not preferable to use.
Not able to use killall, pidof etc. effectively, when long process names
are used for scripts. Just changing the command length from 16 to 32
breaks a.out coredump logic. Deamonise and get_task_comm helped in other
places in 2.6.10.
A couple of one liners to resolve two issues that have come up regarding
audit.
Roger reported a problem with audit.c:audit_receive_skb which improperly
negates the errno argument when netlink_ack is called.
The second issue was reported by Steve on the linux-audit list,
auditsc.s:audit_log_exit using %u instead of %d in the audit_log_format
call.
Please note, there is a mailing list available for audit discussion at
https://www.redhat.com/archives/linux-audit/
Signed-off-by: Peter Martuccelli <peterm@redhat.com> Signed-off-by: Steve Grubb <sgrubb@redhat.com> Signed-off-by: Roger Luethi <rl@hellgate.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 11:16:07 +0000 (03:16 -0800)]
[PATCH] UML: Allow arches to opt out of !SA_INFO signals
x86_64 only delivers signals in the SA_INFO style, whether you ask
for it or not. This patch adds a config option which says whether
the arch is SA_INFO-only or not, and ifdefs out the sigcontext
signal delivery if so.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 11:14:48 +0000 (03:14 -0800)]
[PATCH] UML: code tidying
Some small cleanups that resulted from the x86_64 merge:
Some unneeded includes were removed
Some overlong lines were shortened
current_thread_info was replaced by a generic version.
Some warnings were fixed
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Bodo Stroesser [Tue, 11 Jan 2005 11:14:35 +0000 (03:14 -0800)]
[PATCH] UML: Use va_copy
In arch/um/kernel/skas/uaccess.c, the simple assignment
va_list args = *((va_list *) arg_ptr);
is used in do_buffer_op() to obtain a copy of a va_list, that
was delivered as a pointer only.
But this construction doesn't compile on s390. Instead,
va_copy() and va_end() should be used (see "man va_start").
Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Bodo Stroesser [Tue, 11 Jan 2005 11:14:22 +0000 (03:14 -0800)]
[PATCH] UML: Don't use __NR_waitpid on arches which don't have it
Some architectures (e.g. s390) don't have __NR_waitpid.
Thus, it must not be used in arch/um/kernel/tt/ptproxy/proxy.c
Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 11:13:27 +0000 (03:13 -0800)]
[PATCH] UML: Make a common misconfiguration impossible
This patch makes UML produce error messages instead of silently exiting
when one of several configuration mistakes are made. FD_CHAN is now
mandatory so that people don't turn it off and complain about no boot
messages.
Some printks were turned into printfs in the tt mode gdb code so that they
appear on the screen.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 11:13:13 +0000 (03:13 -0800)]
[PATCH] UML: Separate out signal reception
This patch moves most of the signal handlers to os-Linux, adds an
arch-specific mechanism to get the address of the sigcontext structure,
and implements it for i386 and x86_64.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 11:13:00 +0000 (03:13 -0800)]
[PATCH] UML: x86_64 ptrace support
This adds the x86_64 ptrace support.
It also cleans up the existing code somewhat, eliminating a couple of
simple header files, and generalizing the mk_ptregs buils to accomodate
multiple architectures.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 09:53:34 +0000 (01:53 -0800)]
[PATCH] UML: Factor out register saving and restoring
This moves the register shuffling code into arch/um/os-Linux/sys-$(SUBARCH),
making it purely userspace code. It also adds an x86_64 implementation of
registers.c.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 09:52:52 +0000 (01:52 -0800)]
[PATCH] UML: Three-level page table support
This is the three-level page table support from the x86_64 patch. It can
be enabled on x86, although it's not particularly needed at this point.
However, it can be used to implement very large physical memory (with
almost all of it in highmem) on UML.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 09:52:38 +0000 (01:52 -0800)]
[PATCH] UML: split out arch-specific syscalls from generic ones
This factors out a bunch of non-generic system calls into i386-specific
code. It also adds the x86_64-specific system calls.
A couple of generic system calls handlers are declared in sysdep-i386 because
x86 has no declarations for them, but x86_64 has incompatible ones.
Also splits out syscalls on behalf on UML/S390 from Bodo Stroesser
Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Tue, 11 Jan 2005 09:52:24 +0000 (01:52 -0800)]
[PATCH] UML: Use va_end wherever va_args are used
Finish using va_list correctly, by calling va_end.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andi Kleen [Tue, 11 Jan 2005 09:51:31 +0000 (01:51 -0800)]
[PATCH] x86_64: Fix signal FPU leak on i386 and x86-64
Found by Bodo Stroesser. Description from Bodo:
>>
On i386, if a signal handler is started, the kernel saves the fpu-state
of the interrupted routine in the sigcontext on the stack. Calling
unlazy_fpu() and setting current->used_math=0, the kernel supplies the
signal-handler with a cleared virtual fpu.
On sigreturn(), the old fpu-state of the interrupted routine is
restored.
If a process never used the fpu, it virtually has a cleared fpu.
If such a process is interrupted by a signal handler, no fpu-context is
saved and sigcontext->fpstate is set to NULL.
Assume, that the signal handler uses the fpu. Then, AFAICS, on sigreturn
current->used_math will be 1. Since sigcontext->fpstate still is NULL,
restore_sigcontext() doesn't call restore_i387(). Thus, no
clear_fpu() is done, current->used_math is not reset.
Now, the interrupted processes fpu no longer is cleared!
<<
Fix by AK. Just clear the FPU again when this happens.
Andi Kleen [Tue, 11 Jan 2005 09:50:25 +0000 (01:50 -0800)]
[PATCH] x86_64: Prevent gcc from generating MMX code by mistake.
This will help only on gcc 4+. On older gccs there is a workaround too, but
it is so ugly and there are no actual observed failures that I didn't apply
it.
Andi Kleen [Tue, 11 Jan 2005 09:49:59 +0000 (01:49 -0800)]
[PATCH] x86_64: Remove direct mem_map references
This removes all but one direct reference to mem_map for x86-64. This is
needed on systems where we break the mem_map up and directly indexing into
mem_map to get the page structure doesn't work anymore.
Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andi Kleen [Tue, 11 Jan 2005 09:49:32 +0000 (01:49 -0800)]
[PATCH] x86_64: Fix mptables printk
This fixes the erroneous No mptables found printk on x86_64 mpparse. We will
only print the message now if no mptables are found after all scans complete.
Signed-off-by: Justin M. Forbes <jmforbes@linuxtx.org> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>