sysfs_dir_close did not free the "cursor" sysfs_dirent used for keeping
track of position in the list of sysfs_dirent nodes. Consequently,
doing a "find /sys" would leak a sysfs_dirent for each of the 1140
directories in my /sys tree, or about 36kB each time.
Manfred Spraul [Thu, 2 Dec 2004 23:47:45 +0000 (15:47 -0800)]
[PATCH] proc_pid_status() oops fix
proc_pid_status dereferences pointers in the task structure even if the
task is already dead. This is probably the reason for the oops described
in
http://bugme.osdl.org/show_bug.cgi?id=3812
The attached patch removes the pointer dereferences by using pid_alive()
for testing that the task structure contents is still valid before
dereferencing them. The task structure itself is guaranteed to be valid -
we hold a reference count.
Antonino Daplas [Thu, 2 Dec 2004 23:47:08 +0000 (15:47 -0800)]
[PATCH] fbdev: fix wrong colors at 16 bpp in tridentfb
Timothy Lee reports:
Hardware: CyberBlade/i1 on VIA Epia-800
Problem Description: When the framebuffer is set to 16 bpp, console's text
colours are incorrect. For example, white becomes yellow, black becomes blue, etc.
Steps to reproduce:
1. Load tridentfb
2. Use "setterm -n -depth 16" to request 16 bpp framebuffer
The problem arose from the fact that each psuedo palette entry should be
32-bit in size, even under 16-bit display mode.
Prasanna Meda [Thu, 2 Dec 2004 23:46:44 +0000 (15:46 -0800)]
[PATCH] sys_set/getpriority PRIO_USER semantics fix and optimisation
This change brings the semantics equivalent to 2.4 and also to what the man
page says; Also optimises by avoiding unneeded lookup in uid cache, when
who is same as the current->uid.
sys_set/getpriority is rewritten in 2.5/2.6, perhaps while transitioning to
the pid maps. It has now semantical bug, when uid is zero. Note that akpm
also fixed refcount leak and locking in the new functions in changeset
http://linus.bkbits.net:8080/linux-2.5/cset@1.1608.10.84
Ian Campbell [Thu, 2 Dec 2004 23:46:29 +0000 (15:46 -0800)]
[PATCH] Avoid deadlock in smc91x driver
This patch avoids a deadlock on rtnl_sem in smc_close() when bringing down
an smc91x interface. The semaphore is already held by devinet_ioctl() and
the pending work queue contains linkwatch_event() (scheduled by
netif_carrier_off()) which also wants rtnl_sem hence it is unsafe to call
flush_scheduled_work().
The solution is to track whether we have any pending work of our own and
wait for that instead of flushing the entire queue.
I also fixed a typo 'ence' -> 'Hence' and renamed smc_detect_phy to
smc_phy_detect in order to follow the same pattern as the other smc_phy_*
functions.
Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ingo Molnar [Thu, 2 Dec 2004 23:45:53 +0000 (15:45 -0800)]
[PATCH] acpi_processor_idle() latency fix
We check need_resched() _before_ disabling preemption. This opens up the
following scenario:
swapper: !need_resched()
[IRQ context]
wakes up a task
marks idle task as need-resched
swapper: acpi_processor_idle(); // sleeps until next irq
instant 1msec latency introduced...
normally default_idle() is safe because it re-checks need_resched with
interrupts disabled before it truly halts the CPU. But
acpi_processor_idle() doesnt seem to be doing this! Your trace clearly
shows a missed preemption due to ACPI. I'm wondering why no-one has
triggered this before, it's a really bad bug that should be fixed in
2.6.10.
Anton Blanchard [Thu, 2 Dec 2004 23:45:40 +0000 (15:45 -0800)]
[PATCH] Allow multiple cpus in irq affinity call
The generic irq affinity code limits us to a single cpu target regardless
of what the architecture supports. If required this should be done in the
architecture specific ->set_affinity call.
With this patch ppc64 is able to select all cpus affinity again.
Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
network driver changes:
- qeth: Handle both VLAN_FRAME and INCLUDES_VLAN_TAG in qdio header.
- qeth: Always save IP addresses registered on a card when going offline.
- qeth: Check size of printk buffer to 4K for ipa_takeover, vipa & rxip.
From: Thomas Spatzier <tspat@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Thomas created the patch below which removes the hardcoded 3900 bytes
limit as suggested by Jeff Garzik. Please apply.
network driver changes:
- qeth: Calculate end of sysfs data buffer correctly.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: Thomas Spatzier <tspat@de.ibm.com>
From: Peter Tiedemann <ptiedem@de.ibm.com>
network driver changes:
- qeth: return -EINVAL if an skb is too large.
- qeth: don't call netif_stop_queue after cable pull. Drop the
packets instead.
- qeth: fix race between SET_IP and SET_MC kernel thread by removing
SET_MC thread and let the SET_IP thread do multicast requests as well.
- qeth: make it compile without CONFIG_VLAN.
- ctc: avoid compiler warnings.
- lcs: write package sequence number to skb->cb.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: Horst Hummel <horst.hummel@de.ibm.com>
From: Stefan Weinhuber <wein@de.ibm.com>
dasd driver changes:
- Introduce "fixbuffers" dasd option that uses buffer pages for
the dasd i/o similar to bounce buffers.
- Fix I/O errors when using XRC.
- Increment retry counter again if notifier callback is called with CIO_GONE.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
dcss segment interface changes:
- Add check when loading segments to avoid out of range mappings.
- Add code to check for segment_load returning -ERANGE.
- Rename segment_info to segment_type.
- Restore previous segment state if reload fails.
- Add segment_modify_shared() to change shared attributes of a dcss
segment and use it in the dcss block device driver.
- Add support for contiguous EW/EN multipart segments.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
common i/o layer changes:
- Delay re-registration of a subchannel with a different subchannel id
until the ccw device removal triggered from the subchannels remove
function has completed.
- Fix check when to call unreg_rereg.
- Fix get_disc_cdev_by_devno.
- Activate the time delay disablement facility. This saves a few cycles
in millicode processing.
- Don't ifdef reset of busy start time.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
From: Ulrich Weigand <uweigand@de.ibm.com>
s390 core changes:
- Remove defines for kernel_stack_size and async_stack_size.
- Reserve system call number for kexec.
- Add cc-option check for new gcc option packed-stack.
- Fix race on no_hz_cpu_mask in stop_hz_timer.
- Fix ptrace to make it send a SIGTRAP before the first instruction
of a single stepped signal handler is executed.
- Use force_sig_info with a full siginfo structure for illegal operation.
- Remove verbatim copy of si_codes from asm-s390/siginfo.h. Use the
generic definitions.
- Regenerate default configuration.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Thu, 2 Dec 2004 23:43:53 +0000 (15:43 -0800)]
[PATCH] Work around devices with bogus media change indication on the first open
What that patch does is making the first open _always_ assume that we need to
revalidate/reread partition table and kills partition-parsing in
register_disk(); instead we just have it do open/close and let the
revalidation path in open do the job.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Thu, 2 Dec 2004 23:43:41 +0000 (15:43 -0800)]
[PATCH] blkdev_get_blocks(): handle eof
For reasons which escape me, blockdev_get_blocks() is returning -EIO if the
mapping request straddles the end of the disk. This causes reads which
straddle end-of-disk to return -EIO.
Fix it up so that it correctly trims the returned result down to match the
size of the device, for both reads and writes.
If a write attempt is fully beyond end-of-device then return -EIO. We never
get this far anyway, because generic_write_checks() will return -ENOSPC if all
of the write lies outside a blockdev's i_size.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Thu, 2 Dec 2004 23:43:27 +0000 (15:43 -0800)]
[PATCH] revert the "dio handle eof" fix
This recent fix isn't quite right: it is causing smaller-than-expected I/Os to
be submitted when extending files, which causes AIO-based writes to oops.
So just revert it - the bug was really over in blockdev_get_blocks() anyway.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Edward Falk [Wed, 1 Dec 2004 09:11:14 +0000 (01:11 -0800)]
[PATCH] Documentation for IDE and CDROM ioctls
I've written two document files, and packaged them as a patch.
Two things caught my eye while I was writing this up:
The header comments for CDROMREADRAW, CDROMREADMODE1, and CDROMREADMODE2
disagree with the actual source code. The header comments imply that a
cdrom_read structure is used to pass data, but the source code actually
reads a cdrom_msf structure and then overwrites it with raw data. I'm not
sure if there's a bug in the header comments, in the driver source, or I
misread something.
The CDROM_LOCKDOOR ioctl seems to lock/unlock all doors on all drives,
because it uses a global variable.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rusty Russell [Wed, 1 Dec 2004 09:10:19 +0000 (01:10 -0800)]
[PATCH] Fix occasional stop_machine() lockup with > 2 CPUs
Stephen Rothwell noted a case where one CPU was sitting in userspace, one
in stop_machine() waiting for everyone to enter stopmachine(). This can
happen if migration occurs at exactly the wrong time with more than 2 CPUS.
Say we have 4 CPUS:
1) stop_machine() on CPU 0creates stopmachine() threads for CPUS 1, 2
and 3, and yields waiting for them to migrate to their CPUs and
ack.
2) stopmachine(2) gets rebalanced (probably on exec) to CPU 1.
3) stopmachine(2) calls set_cpus_allowed on CPU 1, sleeps awaiting
migration thread.
4) stopmachine(1) calls set_cpus_allowed on CPU 0, moves onto CPU1 and
starts spinning.
Now the migration thread never runs, and we deadlock. The simplest
solution is for stopmachine() to yield until they are all in place.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Wed, 1 Dec 2004 09:09:52 +0000 (01:09 -0800)]
[PATCH] generic_make_request stack savings
Move this error-handling into a separate function so that its sizeable stack
utilisation is avoided - generic_make_request() can be called recursively by
stacking drivers.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nathan Scott [Wed, 1 Dec 2004 09:09:39 +0000 (01:09 -0800)]
[PATCH] Fix an XFS direct I/O deadlock
Here's a patch which fixes the deadlock Brad Fitzpatrick reported here:
http://lkml.org/lkml/2004/11/14/98
The meat of the problem is a locking order reversal between the XFS I/O
lock and the inode semaphore (i_sem). When we mix a number of threads
doing both direct reads and writes, we hit an ABBA deadlock after a while
because direct-io.c is taking and dropping i_sem after the XFS read path
has already taken its I/O lock. This is the wrong way around from XFS's
point of view, in particular its the opposite order to the XFS write path.
So this patch changes the logic for direct reads in the DIO_OWN_LOCKING
case (i.e. XFS-only case), but leaves things as is for the other two types
of locking.
Not real pretty, but fixes up the lock ordering and deadlock.
Oh, I have tested direct reads and writes on ext3 and block devices as
well, to ensure they still function correctly with the change (i.e. they
don't regress, should be a no-op there) which covers the other locking
cases in __blockdev_direct_IO.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hirofumi Ogawa [Wed, 1 Dec 2004 09:09:25 +0000 (01:09 -0800)]
[PATCH] cont_prepare_write() fix
When cont_prepare_write() is padding out the "hole" with zeroed pages it
doesn't increase i_size at the same time. If writeback comes in during the
execution of cont_prepare_write(), block_write_full_page() will think that
these pages are outside i_size and will just clean the page without writing
it.
Fix that up by using generic_commit_write(), which will advance i_size for
each page as it is dirtied.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Pavel Machek [Wed, 1 Dec 2004 09:08:44 +0000 (01:08 -0800)]
[PATCH] swsusp kconfig: Change in wording
Vadim says:
I was reading through the kernel/power/Kconfig file, and noticed that
the wording was slightly unclear. I poked at it a bit, hopefully making
the description a tad more straightforward, but you be the judge. :)
Diffed against 2.6.10-rc2.
From: Vadim Lobanov <vlobanov@speakeasy.net> Signed-off-by: Vadim Lobanov <vlobanov@speakeasy.net> Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 1 Dec 2004 09:08:30 +0000 (01:08 -0800)]
[PATCH] md: fix jiffies handling in md.c
Use time_after_eq instead of >=
From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 1 Dec 2004 09:08:17 +0000 (01:08 -0800)]
[PATCH] md: fix careless bug in raid10
raid10 performs resync by reading all blocks, comparing to look for The
requires re-tasking a bio that was used to read, so that it can be re-used
for write. So a number of fields need to be reset.
The bi_bdev field was not being reset. However when using on a partition
of a device, it gets changed by generic_make_request.
This patch simply resets bi_bdev to the correct value.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Buffer overrun in arch/x86_64/sys_ia32.c:sys32_ni_syscall()
With Chris Wright <chrisw@osdl.org>
struct task_struct.comm is defined to be 16 chars, but
arch/x86_64/sys_ia32.c:sys32_ni_syscall() and sys32_vm86_warning() copy it
into a static 8 byte buffer, which will surely cause problems. This patch
makes lastcomm[] the right size, and makes sure it can't be overrun. Since
the code also goes to the effort of getting a local copy of current in "me",
we may as well use it for printing the message.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ralf Bächle [Wed, 1 Dec 2004 09:07:46 +0000 (01:07 -0800)]
[PATCH] MIPS updates
o General updates of MIPS to 2.6.10-rc2
o Remove the Baget platform due to lack of maintenance over several years.
Some of the drivers remain and will be removed in a separate patch.
o Remove the HP Laserjet platform. No user reports ever and no patches from
the original submitters made this port a neat hack - and a directory full
of clutter.
o SMP support for the PMC-Sierra.
Holger Freyther [Wed, 1 Dec 2004 16:23:46 +0000 (16:23 +0000)]
[ARM PATCH] 2283/1: SA1100 USB Config options
Patch from Holger Hans Peter Freyther
arch/arm/mach-sa1100/KConfig had options for USB client. The related code was removed early in 2.6. releases.
I think it is appropriate to remove the Config options for it itself, as they're void.
Signed-off-by: Holger Hans Peter Freyther Signed-off-by: Russell King
Len Brown [Wed, 1 Dec 2004 08:59:57 +0000 (03:59 -0500)]
[ACPI] disable LAPIC at reboot and poweroff if Linux forced it on
http://bugzilla.kernel.org/show_bug.cgi?id=3643
Signed-off-by: Alexey Y Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Len Brown <len.brown@intel.com>
Alternate workaround for blocking usage of select() by UDP applications.
The problem is Linux optimizes the UDP receive checksum path so that checksum
validation is not performed until the application read. This is a performance win
but can cause applications that do select with blocking file descriptors to get false
positives if the received message has a checksum error.
There is a long running thread about this on LKML.
This patch makes these applications work, but keeps the one-pass performance gain
for those applications smart enough to use non-blocking file descriptors with
select/poll. There is still a possibility to get a false positive if application does
select on non-blocking fd then makes it blocking before doing the receive, but that
is unlikely.
Tested by injecting bad packets with SOCK_RAW.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
While looking at the SCM passing code in net/core/scm.c I noticed that there's
a 32-bit compat implementation of scm_detach_fds()'s called
scm_detach_fds_compat() living in net/compat.c. While these two functions
are mostly the same the latter does not include the call to the
security_file_receive() hook which is almost certainly a bug.
Signed-off-by: Mitchell Blank Jr <mitch@sfgoth.com> Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjorn Helgaas [Tue, 30 Nov 2004 00:51:09 +0000 (16:51 -0800)]
[IA64] Bigsur config: Add CONFIG_SERIAL_8250_ACPI so we can find serial devices
In the absence of an HCDP, we used to assume there were legacy COM ports
at 0x3f8 and 0x2f8, but I recently removed that assumption.
"console=ttyS0" still works (assuming you have CONFIG_SERIAL_8250_ACPI
turned on so you can find the ttyS0 device), but the console doesn't
start working until the serial driver initializes. If you need an
early console and you know where it lives, something like
"console=uart,io,0x3f8" will start working very early.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Jens Axboe [Tue, 30 Nov 2004 00:12:38 +0000 (16:12 -0800)]
[PATCH] cfq-iosched: kill show_status sysfs entry
This is a debug entry that isn't of much use to the generic user or on a
production system. Additionally it can also easy overflow the sysfs
PAGE_SIZE limitation, if you have many processes doing io. So kill the
entry.
Rusty Russell [Mon, 29 Nov 2004 12:24:39 +0000 (04:24 -0800)]
[PATCH] Remove Futex Warning
If we're waiting on a futex and we are woken up, it's either because
someone did FUTEX_WAKE, we timed out, or have been signalled. However, the
WARN_ON(!signal_pending(current)) test is overzealous: with threads (a
common use of futexes), we share the signal handler and the other
thread might get to the signal before us. In addition, exit_notify()
can do a recalc_sigpending_tsk() on us, which will then clear our
TIF_SIGPENDING bit, making signal_pending(current) return false.
Returning EINTR is a little strange in this case, since this thread
hasn't handled a signal. However, with threads it's the best we can
do: there's always a race where another thread could have been the
actual one to handle the signal.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ben Dooks [Mon, 29 Nov 2004 15:23:14 +0000 (15:23 +0000)]
[ARM PATCH] 2285/1: S3C2410 - regs-sdi.h fixes
Patch from Ben Dooks
Fixes from Koen Martens to update the
register definitions for the MMC/SD/SDIO interface,
tidied up for release with extra notes on what has
been depreceated in later silicon.
Signed-off-by: Koen Martens Signed-off-by: Ben Dooks Signed-off-by: Russell King