Andrew Morton [Fri, 6 Feb 2004 00:50:15 +0000 (16:50 -0800)]
[PATCH] ext2/3: incorrect increment of i_blocks when keeping the same xattr block
From: Andreas Gruenbacher <agruen@suse.de>
Here is a fix for extended attributes on ext2 and ext3, reported by
Stephen Tweedie <sct@redhat.com>.
From: Stephen Tweedie <sct@redhat.com>:
When you have an EA block that is shared between multiple inodes; AND you
then change an attribute in that on one inode, AND the new attribute value
is the same as the old, then xattr computes the new EA block, finds it
still in the cache, bumps the reference count on it (and the i_blocks field
on the inode, incidentally), and leaves it incremented because we haven't
changed EA block so there's no need to drop the refcount on the old block.
So *every* time you have more than one inode sharing an EA block and you
perform an identical write to an EA, you get a leak on both i_blocks and
the EA refcount.
This is a big problem for symlinks, which rely on correct i_blocks
accounting to determine the difference between fast and slow symlinks.
With the leak, you end up thinking that a fast symlink (ie. one small
enough to be stored in the inode direct blocks) is slow, so you dereference
the ascii contents of the symlink as if they were a disk block address.
That typically results in EIO all over the place.
Andrew Morton [Fri, 6 Feb 2004 00:49:57 +0000 (16:49 -0800)]
[PATCH] With size > XATTR_SIZE_MAX, getxattr(2) always returns E2BIG
From: Andreas Gruenbacher <agruen@suse.de>
The getxattr (listxattr) syscall returns E2BIG if the buffer passed to them
is bigger than XATTR_SIZE_MAX (XATTR_LIST_MAX), no matter what buffer size is
actually required. Here is a fix. It also removes the xattr_alloc and
xattr_free functions which are not of much use anymore.
Andrew Morton [Fri, 6 Feb 2004 00:49:39 +0000 (16:49 -0800)]
[PATCH] gcc-3.5: drivers/atm/atmtcp.c
drivers/atm/atmtcp.c: In function `atmtcp_c_close':
drivers/atm/atmtcp.c:258: error: invalid lvalue in assignment
drivers/atm/atmtcp.c: In function `atmtcp_create':
drivers/atm/atmtcp.c:383: error: invalid lvalue in assignment
Andrew Morton [Fri, 6 Feb 2004 00:49:30 +0000 (16:49 -0800)]
[PATCH] ppc64: Add readq/writeq and __raw* IO functions
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This patch adds those for ppc64, except for iSeries which cannot do
readq/writeq easily, at least not as far as I know but I need to ask the
iSeries specialists in Rochester to be sure. But anyway, iSeries shouldn't
use anything in fb.h anyway ...
It also add the proper tweaks & barriers to make sure reads are actually
done right away and not delayed indefinitely (making the CPU think the read
data is actually used) and add necessary write barriers on IO writes. For
some reasons, ppc64 in 2.6 lacked some of these, opening potential races
within some drivers.
Andrew Morton [Fri, 6 Feb 2004 00:49:10 +0000 (16:49 -0800)]
[PATCH] ppc32: Update PowerMac dmasound driver
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This patch was missing from my big merge. It updates the PowerMac
"dmasound" driver. Adds input support for some recent machines using the
tas3004 coded/mixer chip. Code mostly written by Renzo Davoli.
This driver isn't (unfortunately) fully obsoleted by the Alsa one. There
are lots of reports of the Alsa one not working properly on various
PowerMac machines, and some people are unhappy with Alsa in general, enough
to have ported the messy PowerMac dmasound to 2.6 :)
Add support for Apple latest laptops, add a warning when building
an SMP kernel (the core cpufreq doesn't scale loops_per_jiffies
properly on SMP kernels), cleanup some code.
Adapt to "macio" driver infrastructure, cleanup power management, make some
functions static, fix IO accessors, remove local list of commands/directions,
etc...
This driver could use more work & study of the interesting ASIC bugs
documented in Apple source code...
Note that I'm removing support for the CHRP machines using the MESH as
part of the "Hydra" ASIC. Nobody sane really uses that, but if one of
the 3 remaining Longtrail users want to fix that, then move Hydra to
use the "macio" model...
Adapt to the "macio" driver infrastructure, cleanup IO accessors,
remove local list of command/directions, uses infos provided by
the SCSI layer. This driver certainly could use some more work.
The cascaded northbridge MPIC is currently dealt with a special
modified version of open_pic.c (open_pic2.c). A better mecanism
will have to be found for 2.7
Create a low-level synchronous implementation suitable for use
by the early boot platform code or other places where the
asynchronous driver isn't useable. This also exports the locks
used by the real driver to avoid collisions.
Use this new implementation to properly setup the clock chip
at boot on Apple latest laptops
ppc32: Fix release_OF_resource() function.
It would fail to properly release the resource if taken over
by the macio device resource hierarchy. This could still use
some locking, but the io resource lock isn't exported
ppc32: fix a possible race in pte_free()
Another processor could be walking the page table in the middle of the
PTE page to be freeded. Synchronize with hash_page using the lock.
On G5 machines, we remap the AGP port to bus number 0xf0. XFree
contains a hack that is unfixable at the moment for getting the
IO base which is hard coded to bus number 0 (AGP on earlier machines).
We work around this by passing the IO base of bus 0xf0 when asked
for bus 0 in pciconfig_iobase on those machines. Bus 0 is the HT
root and has no IOs, so that is safe.
Move pmac-specific PCI quirks to pmac_pci.c, update cardbus one for new
TI controller, add some for fixing up ATA & SATA controllers (switch normal
ATA to fully native mode and disable unused function on G5 K2 SATA)
Andi Kleen [Thu, 5 Feb 2004 05:40:40 +0000 (21:40 -0800)]
[PATCH] put "kernel_thread_helper" in right linker segment
This fixes the "kernel_thread_helper" function so that it is in the
right segment (.text) regardless of any other code movement by the
compiler (eg "-funit-at-a-time").
Andrew Morton [Thu, 5 Feb 2004 05:20:06 +0000 (21:20 -0800)]
[PATCH] ppc64: Fix another numa bug
From: anton@samba.org
In some cases we can merge reserved regions with the next node. There was a
bug in the way we calculated the overlapping region which caused us to fail
during boot.
[PATCH] remove ide_dma_queued_* ops from ide_hwif_t
TCQ code is host independent so remove redundant ide_dma_queued_* ops from
ide_hwif_t. If we ever decide to bring back TCQ support this will fix OOPS
in ide-disk driver with CONFIG_BLK_DEV_IDE_TCQ_DEFAULT=y and icside/sgiioc4
host drivers (it will also enable TCQ support for these host drivers).
[PATCH] fix 'cat /proc/ide/<cd|dvd>/identify' hang (CONFIG_IDE_TASKFILE=y)
Some devices need more time to become non-busy after command completion,
so use the same timeout in wait_drive_not_busy() (called from task_in_intr()
if CONFIG_IDE_TASKFILE_IO=y) as in drive_cmd_intr().
Thanks to Mark Haverkamp <markh@osdl.org> for help in fixing this.
Alexander Viro [Thu, 5 Feb 2004 01:47:21 +0000 (17:47 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (6/9)
* fixed missing wakeups in ppa_pb_claim()/ppa_wakeup() - if the
former had been called just as current holder of port was giving it up,
we could set "I'm waiting" flag too late. Cleaned up the timeout logics.
Alexander Viro [Thu, 5 Feb 2004 01:47:09 +0000 (17:47 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (5/9)
* starting to kill ppa_detect - we move the "probe a single port"
logics into a separate function and shift scanning into ppa_driver_init().
Later that will give us a parport_driver ->attach().
Alexander Viro [Thu, 5 Feb 2004 01:46:34 +0000 (17:46 -0800)]
[PATCH] scsi/ppa.c cleanup and fixes (4/9)
* killed include of scsi_module.h and switched from scsi_register()
to scsi_alloc_host(). We still keep the old detect logics at that point,
it will be gone later.
Alexander Viro [Thu, 5 Feb 2004 01:40:55 +0000 (17:40 -0800)]
[PATCH] scsi/imm.c cleanup and fixes (6/8)
* fixed missing wakeups in imm_pb_claim()/imm_wakeup() - if the
former had been called just as current holder of port was giving it up,
we could set "I'm waiting" flag too late. Cleaned up the timeout logics.
Alexander Viro [Thu, 5 Feb 2004 01:39:40 +0000 (17:39 -0800)]
[PATCH] scsi/imm.c cleanup and fixes (5/8)
* starting to kill imm_detect - we move the "probe a single port"
logics into a separate function and shift scanning into imm_driver_init().
Later that will give us a parport_driver ->attach().