Linus Torvalds [Sun, 2 May 2004 06:04:40 +0000 (23:04 -0700)]
Make types of big integers in bitops.h explicit.
"sparse" warns about implicit type conversions that may cause
surprising results. Did you know that large decimal types have
different type conversions from large hexadecimals?
the following patch converts the error handling paths in VFAT fs to use
goto, making it more consistent with other filesystem code. Shrinks the
resulting binary by 144 bytes in my build.
Alexander Viro [Sat, 1 May 2004 12:53:15 +0000 (05:53 -0700)]
[PATCH] mcdx.c insanity removal
The mcdx.c author had pulled off something absolutely amazing - he had
declared several unsigned variables (ISA port numbers) as void *, using
explicit cast to unsigned in almost all places that used them.
Exception: printk. There he proudly used them as pointers - with %3p in
format. That cute trick allowed him to avoid using %03x, which
apparently scared him for some reason.
Switched to use of unsigned, killed casts, replaced %3p with %03x in
formats. BTW, the code had been that way since the initial merge back
in 1.3.7...
Paul Mackerras [Sat, 1 May 2004 12:10:20 +0000 (05:10 -0700)]
[PATCH] ppc64: fix incorrect signal handler argument
This fixes a bug in the ppc64 signal delivery code where the signal
number argument to a signal handler can get corrupted before the handler
is called. The specific scenario is that a process is in a blocking
system call when two signals get generated for it, both of which have
handlers.
The signal code will stack up two signal frames on the process stack
(assuming the mask for the first signal delivered doesn't block the
second signal) and return to userspace to run the handler for the second
signal. On return from that handler the first handler gets run with an
incorrect signal number argument because we end up with regs->result
still having a negative value (left over from when the system call was
interrupted) when it should be zero. This patch sets it to zero when we
set up the signal frame (in three places; for 64-bit processes, and for
32-bit processes for RT and non-RT signals).
The way we handle signal delivery and signal handler return using the
regs->result field in ppc64 is more complicated than it needs to be. In
ppc32 I have already simplified it and eliminated use of the
regs->result field. I am going to do the same in the ppc64 code, but I
think this patch should go in for now to fix the bug.
The patch also fixes a couple of places where we were unnecessarily and
incorrectly truncating the regs->result value to 32 bits
(sys32_sigreturn and sys32_rt_sigreturn return a long value, as all
syscalls do, and if regs->result is negative we need those syscalls to
return a negative value).
Thanks to Maneesh Soni for identifying the specific circumstances
under which this bug shows up.
Herbert Xu [Sat, 1 May 2004 10:39:13 +0000 (03:39 -0700)]
[IPV4/IPV6]: Fix listing of listening sockets.
There is a bug in listening_get_first() which used by /proc/net/tcp*
where it wasn't looping through all the sockets in each hash chain.
This problem doesn't show up unless the first socket in a chain doesn't
match the family that is being looked up.
The following patch fixes this by getting rid of listening_get_first()
altogether.
Denis Vlasenko [Sat, 1 May 2004 10:32:45 +0000 (03:32 -0700)]
[PATCH] add missing #include
There's a subtle problem with "inline" usage in <linux/string.h>:
<linux/string.h>:
this pulls in __constant_c_and_count_memset()
<linux/mm.h>:
this pulls <compiler.h>, re-defining
inline == __inline__ __attribute__((always_inline)).
But by now it is too late! The compiler has already seen the bare
"inline" in string.h, and hasn't inlined it.
Result:
# grep __constant System.map c0144670 t __constant_c_and_count_memset c0145c60 t __constant_c_and_count_memset
... many more copies of this function ...
On OSB4 the hwif->ultra_mask is set to not support UDMA.
Unfortunately in that case svwks_config_drive_xfer_rate()
falls through to the end of the function, instead of trying
other DMA modes.
Nicolas Pitre [Fri, 30 Apr 2004 21:51:18 +0000 (22:51 +0100)]
[ARM PATCH] 1839/1: fix lubbock_flash.c which used a bogus reg name
Patch from Nicolas Pitre
Before previous patch this driver compiled OK but was buggy.
Now it doesn't compile anymore as the bogus macro has been
deleted. Fix that in any case.
The same fix has been committed to the MTD CVS already, but please forward
this to Linus otherwise Lubbock won't compile from kernel.org tree anymore
(waiting for dwmw2 to update this might prove ... hrm ... long)
Nicolas Pitre [Fri, 30 Apr 2004 21:47:10 +0000 (22:47 +0100)]
[ARM PATCH] 1838/1: Lubbock leds and macro namespace cleanup
Patch from Nicolas Pitre
Too many macro with too generic names. Let's remove unneeded code and
redundant/unused macros. This also prevent namespace clash with upcoming
patches.
Andrew Morton [Fri, 30 Apr 2004 07:51:54 +0000 (00:51 -0700)]
[PATCH] task_struct alignment fix
The recent slab alignment changes broke an unknown number of architectures
(parisc and x86_64 for sure) by causing task_structs to be insufficiently
aligned.
We need good alignemnt because architectures do things like dumping FP state
into the task_struct with instructions which require particular alignment (I
think).
So change the default alignment to L1_CACHE_BYTES, which is what we used to
have, via SLAB_HW_CACHE_ALIGN.
Russell King [Fri, 30 Apr 2004 05:37:45 +0000 (22:37 -0700)]
[PATCH] Update MTD concatenating driver
This patch updates the MTD concatenating driver from MTD CVS, which
fixes issues found with this driver which concatenates multiple MTD
devices into one MTD device.
From David Woodhouse, through CVS:
revision 1.8
date: 2003/06/30 11:01:26; author: dwmw2; state: Exp; lines: +5 -5
I will not commit stuff whilst pissed
I will not commit stuff whilst pissed
Andrew Morton [Fri, 30 Apr 2004 00:42:38 +0000 (17:42 -0700)]
[PATCH] ppc64: shmget() translation bugfix
From: David Gibson <david@gibson.dropbear.id.au>
The 32->64 bit syscall translation layer on ppc64 incorrectly sign-
extends rather than zero-extending the second parameter to shmget(),
which should be a size_t. This means that it is impossible to shmget()
more 2GB or more from a 32-bit process.
Andrew Morton [Fri, 30 Apr 2004 00:42:14 +0000 (17:42 -0700)]
[PATCH] s390: oprofile Kconfig fixes
From: Arnd Bergmann <arnd@arndb.de>
Enable basic profiling code on s390 depending on CONFIG_PROFILING, not
CONFIG_OPROFILE.
CONFIG_PROFILING should enable the generic profiling code here, even if
CONFIG_OPROFILE is not set. Note that the identical code on i386 is always
compiled in, regardless of CONFIG_PROFILING and CONFIG_OPROFILE.
[PATCH] NFSv3: Fix SETATTR call after O_EXCL create
Ensure that when we send the SETATTR call after doing an O_EXCL create,
we always set the atime and ctime fields.
See RFC1813 for details on why the server is allowed to clobber these
two fields in order to cache a verifier that protects CREATE in case of
a timeout+resend from the client.
Andrew Morton [Thu, 29 Apr 2004 00:21:10 +0000 (17:21 -0700)]
[PATCH] writeback livelock fix
To avoid various livelocks, the writeback code parks all the dirty inodes onto
sb->s_io and then works through that list until it is empty. This assumes
that each inode will be moved to some other list as it is processed.
But there's a loophole: if the ->writepages() implementation does nothing at
all, the inode is not redirtied (which would move it to s_dirty). This causes
s_io to not empty and pdflush goes nuts.
So when this happens, move the inode onto s_dirty within
__sync_single_inode(). Use list_move_tail() to attempt to preserve the
time-ordering of the s_dirty list.
Andrew Morton [Thu, 29 Apr 2004 00:19:30 +0000 (17:19 -0700)]
[PATCH] s390: network driver
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Network driver changes:
- ctc: Add missing irb error checking.
- iucv: Add name of net_device to iucvMagic to more than one
connection between two guests.
- qeth: Don't send IPA command if card is not in state SOFTSETUP or UP.
- qeth: Fix number base in simple_strtoul call for buffer_count attribute.
- qeth: Fix reallocating of buffers when buffer_count attribute is changed.
- qeth: Correct handling of return codes in qeth_realloc_buffer_pool.
- qeth: Don't call dev_close/dev_open on STOPLAN/STARTLAN commands.
Use netif_carrier_off/netif_carrier_on instead.
Andrew Morton [Thu, 29 Apr 2004 00:19:17 +0000 (17:19 -0700)]
[PATCH] s390: common i/o layer
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Common i/o layer changes:
- Don't use bus ids in crw debug feature.
- Use cio_oper for oper notification to disconnected devices.
- Remove __get_subchannel_by_stsch.
- Make cio workqueue a single threaded workqueue.
- Introduce addiotnal cio_notify workqueue for device driver notification.
- Switch off path in vpm if cio_start returned -ENODEV.
- Fix rescan for new subchannels after a logical vary on.
Andrew Morton [Thu, 29 Apr 2004 00:19:03 +0000 (17:19 -0700)]
[PATCH] s390: core s390
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390 core changes:
- Move setting/clearing of TIF_31BIT thread flag to SET_PERSONALITY.
- Use TASK_UNMAPPED_BASE in elf_map32 for mmaps with address 0.
- Define ARCH_KMALLOC_MINALIGN.
- Define ARCH_MIN_TASKALIGN.
Andrew Morton [Thu, 29 Apr 2004 00:18:37 +0000 (17:18 -0700)]
[PATCH] cciss build fix
From: <mikem@beardog.cca.cpqcorp.net>
This patch fixes the linux/include/cciss_ioctl.h file. When support for the
cciss big ioctl was added the stucture in the header was put in the wrong
place. If an application includes the file it will fail to compile.
Andrew Morton [Thu, 29 Apr 2004 00:18:11 +0000 (17:18 -0700)]
[PATCH] ppc32: compile error in signal.c
From: Meelis Roos <mroos@linux.ee>
arch/ppc/kernel/signal.c: In function `handle_signal':
arch/ppc/kernel/signal.c:518: error: `newspp' undeclared (first use in this function)
arch/ppc/kernel/signal.c:518: error: (Each undeclared identifier is reported only once
arch/ppc/kernel/signal.c:518: error: for each function it appears in.)
arch/ppc/kernel/signal.c:518: warning: long unsigned int format, pointer arg (arg 3)
Alexander Viro [Thu, 29 Apr 2004 00:15:20 +0000 (17:15 -0700)]
[PATCH] Fix might_sleep in /proc/swaps code
This fixes a locking problem noted by Tim Hockin:
* /proc/swaps uses seq_file code, calling seq_path() with swaplock held
* seq_path() calls d_path()
* d_path() calls mntput() which might_sleep()
We add a new semaphore protecting insertions/removals in the set of swap
components + switch of ->start()/->stop() to the same semaphore [fixes
deadlocks] + trivial cleanup of ->next().
David Gibson [Thu, 29 Apr 2004 00:12:31 +0000 (17:12 -0700)]
[PATCH] POWER5 erratum workaround
Early POWER5 revisions (<DD2.1) have a problem requiring slbie
instructions to be repeated under some circumstances. The patch below
adds a workaround (patch made by Anton Blanchard).
David Gibson [Thu, 29 Apr 2004 00:11:59 +0000 (17:11 -0700)]
[PATCH] Fix overeager stack-expansion on ppc64
This fix is from Paul Mackerras and was applied in 2.4 sometime late
last year.
On ppc64, touching addresses between the highest other mapping and the
stack can cause the stack to be extended way, way down, rather than
causing a SEGV as you would expect. This patch only allows the stack
mapping to be extended to cover addresses actually within the stack
(as determined by looking at the process's r1). This fix is ported
from 2.4
This fixes failures on the LTP's shmdt01, munmap01 and munmap02 tests.
[PATCH] fix default IDE interfaces initialization for PPC32
In ide_init_default_irq() patch I overlooked that ppc_ide_md.init_hwif_ports()
called from generic ide_init_hwif_ports() can set hwif->irq and it will
be overwritten by ide_init_default_irq() if CONFIG_PCI is defined. Fix
it.
I will clean it up properly later after killing ide_init_hwif_ports() on
ARM{26}. Doing it now is just wasted effort.