linux-2.6
18 years ago[PATCH] cpuset: top_cpuset tracks hotplug changes to cpu_online_map
Paul Jackson [Sun, 27 Aug 2006 08:23:51 +0000 (01:23 -0700)] 
[PATCH] cpuset: top_cpuset tracks hotplug changes to cpu_online_map

Change the list of cpus allowed to tasks in the top (root) cpuset to
dynamically track what cpus are online, using a CPU hotplug notifier.  Make
this top cpus file read-only.

On systems that have cpusets configured in their kernel, but that aren't
actively using cpusets (for some distros, this covers the majority of
systems) all tasks end up in the top cpuset.

If that system does support CPU hotplug, then these tasks cannot make use
of CPUs that are added after system boot, because the CPUs are not allowed
in the top cpuset.  This is a surprising regression over earlier kernels
that didn't have cpusets enabled.

In order to keep the behaviour of cpusets consistent between systems
actively making use of them and systems not using them, this patch changes
the behaviour of the 'cpus' file in the top (root) cpuset, making it read
only, and making it automatically track the value of cpu_online_map.  Thus
tasks in the top cpuset will have automatic use of hot plugged CPUs allowed
by their cpuset.

Thanks to Anton Blanchard and Nathan Lynch for reporting this problem,
driving the fix, and earlier versions of this patch.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: Nathan Lynch <ntl@pobox.com>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: fix recent breakage of md/raid1 array checking
NeilBrown [Sun, 27 Aug 2006 08:23:50 +0000 (01:23 -0700)] 
[PATCH] md: fix recent breakage of md/raid1 array checking

A recent patch broke the ability to do a user-request check of a raid1.
This patch fixes the breakage and also moves a comment that was dislocated
by the same patch.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] md: avoid backward event updates in md superblock when degraded.
NeilBrown [Sun, 27 Aug 2006 08:23:49 +0000 (01:23 -0700)] 
[PATCH] md: avoid backward event updates in md superblock when degraded.

If we
  - shut down a clean array,
  - restart with one (or more) drive(s) missing
  - make some changes
  - pause, so that they array gets marked 'clean',
the event count on the superblock of included drives
will be the same as that of the removed drives.
So adding the removed drive back in will cause it
to be included with no resync.

To avoid this, we only update the eventcount backwards when the array
is not degraded.  In this case there can (should) be no non-connected
drives that we can get confused with, and this is the particular case
where updating-backwards is valuable.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] eventpoll.c compile fix
Masoud Asgharifard Sharbiani [Sun, 27 Aug 2006 08:23:48 +0000 (01:23 -0700)] 
[PATCH] eventpoll.c compile fix

Fix two compile failures in eventpoll.c code which would happen if
DEBUG_EPOLL is bigger than zero.

Signed-off-by: Masoud Sharbiani <masouds@google.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Documentation update for relay interface
Tom Zanussi [Sun, 27 Aug 2006 08:23:47 +0000 (01:23 -0700)] 
[PATCH] Documentation update for relay interface

Here's updated documentation for the relay interface, rewritten to match
the relayfs->relay changes.  It also moves relayfs.txt to relay.txt in the
process.

It includes the changes to relayfs.txt previously posted by Randy Dunlap,
thanks for those.

The relay-apps examples have also been updated to match, and can be found
on the sourceforge relayfs website.

Signed-off-by: Tom Zanussi <zanussi@us.ibm.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Remove redundant up() in stop_machine()
Yingchao Zhou [Sun, 27 Aug 2006 08:23:46 +0000 (01:23 -0700)] 
[PATCH] Remove redundant up() in stop_machine()

An up() is called in kernel/stop_machine.c on failure, and also in the
caller (unconditionally).

Signed-off-by: Zhou Yingchao <yingchao.zhou@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ufs: truncate correction
Evgeniy Dushistov [Sun, 27 Aug 2006 08:23:46 +0000 (01:23 -0700)] 
[PATCH] ufs: truncate correction

1) When we allocated last fragment in ufs_truncate, we read page, check
   if block mapped to address, and if not trying to allocate it.  This is
   wrong behaviour, fragment may be NOT allocated, but mapped, this
   happened because of "block map" function not checked allocated fragment
   or not, it just take address of the first fragment in the block, add
   offset of fragment and return result, this is correct behaviour in
   almost all situation except call from ufs_truncate.

2) Almost all implementation of UFS, which I can investigate have such
   "defect": if you have full disk, and try truncate file, for example 3GB
   to 2MB, and have hole in this region, truncate return -ENOSPC.  I tried
   evade from this problem, but "block allocation" algorithm is tied to
   right value of i_lastfrag, and fix of this corner case may slow down of
   ordinaries scenarios, so this patch makes behavior of "truncate"
   operations similar to what other UFS implementations do.

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ufs: write to hole in big file
Evgeniy Dushistov [Sun, 27 Aug 2006 08:23:45 +0000 (01:23 -0700)] 
[PATCH] ufs: write to hole in big file

On UFS, this scenario:
open(O_TRUNC)
lseek(1024 * 1024 * 80)
write("A")
lseek(1024 * 2)
write("A")

may cause access to invalid address.

This happened because of "goal" is calculated in wrong way in block
allocation path, as I see this problem exists also in 2.4.

We use construction like this i_data[lastfrag], i_data array of pointers to
direct blocks, indirect and so on, it has ceratain size ~20 elements, and
lastfrag may have value for example 40000.

Also this patch fixes related to handling such scenario issues, wrong
zeroing metadata, in case of block(not fragment) allocation, and wrong goal
calculation, when we allocate block

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ext3 filesystem bogus ENOSPC with reservation fix
Mingming Cao [Sun, 27 Aug 2006 08:23:44 +0000 (01:23 -0700)] 
[PATCH] ext3 filesystem bogus ENOSPC with reservation fix

To handle the earlier bogus ENOSPC error caused by filesystem full of block
reservation, current code falls back to non block reservation, starts to
allocate block(s) from the goal allocation block group as if there is no
block reservation.

Current code needs to re-load the corresponding block group descriptor for
the initial goal block group in this case.  The patch fixes this.

Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] ext2: prevent div-by-zero on corrupted fs
Andries Brouwer [Sun, 27 Aug 2006 08:23:43 +0000 (01:23 -0700)] 
[PATCH] ext2: prevent div-by-zero on corrupted fs

Mounting an ext2 filesystem with zero s_inodes_per_group will cause a
divide error.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Fix for minix crash
Andries Brouwer [Sun, 27 Aug 2006 08:23:42 +0000 (01:23 -0700)] 
[PATCH] Fix for minix crash

Mounting a (corrupt) minix filesystem with zero s_zmap_blocks
gives a spectacular crash on my 2.6.17.8 system, no doubt
because minix/inode.c does an unconditional
minix_set_bit(0,sbi->s_zmap[0]->b_data);

[akpm@osdl.org: make labels conistent while we're there]

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] MTD NAND: Fix ams-delta after core conversion
Jonathan McDowell [Sun, 27 Aug 2006 08:23:41 +0000 (01:23 -0700)] 
[PATCH] MTD NAND: Fix ams-delta after core conversion

The recent hwctrl core conversion for MTD NAND devices broke the Amstrad
Delta driver.  This fixes it up and uses the existing control line defines
rather than unclear magic numbers.

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] futex_find_get_task(): remove an obscure EXIT_ZOMBIE check
Oleg Nesterov [Sun, 27 Aug 2006 08:23:40 +0000 (01:23 -0700)] 
[PATCH] futex_find_get_task(): remove an obscure EXIT_ZOMBIE check

futex_find_get_task:

if (p->state == EXIT_ZOMBIE || p->exit_state == EXIT_ZOMBIE)
return NULL;

I can't understand this.  First, p->state can't be EXIT_ZOMBIE.  The
->exit_state check looks strange too.  Sub-threads or tasks whose ->parent
ignores SIGCHLD go directly to EXIT_DEAD state (I am ignoring a ptrace
case).  Why EXIT_DEAD tasks should be ok?  Yes, EXIT_ZOMBIE is more
important (a task may stay zombie for a long time), but this doesn't mean
we should explicitely ignore other EXIT_XXX states.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] vcsa attribute bits -> ioctl(VT_GETHIFONTMASK)
Samuel Thibault [Sun, 27 Aug 2006 08:23:39 +0000 (01:23 -0700)] 
[PATCH] vcsa attribute bits -> ioctl(VT_GETHIFONTMASK)

When reading /dev/vcsa while a font with more than 256 characters is
loaded, one of the attribute bits records the 9th bit of the character.
But depending on the console driver (vgacon or fbcon for instance), that's
bit 3 or bit 0.  And there is no way for userland to know that, thus no way
for userland to safely grab the screen content.  So here is a (tested)
patch:

Add a VT_GETHIFONTMASK ioctl for knowing which bit is the 9th bit for VC
text (vc_hi_font_mask field of the vc_data structure).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] matroxfb: fix jittery display on non-ppc systems
Paul A. Clarke [Sun, 27 Aug 2006 08:23:37 +0000 (01:23 -0700)] 
[PATCH] matroxfb: fix jittery display on non-ppc systems

I wish I was happier about this patch.  It'll serve as a placeholder for
the moment.  I'm still trying to get a G550 working in order to even
reproduce the problem this patch introduces.  I find that the G450 has
jitter even without this patch, so it won't show me what the patch changed.
 At this point, I'll continue trying to get the G550 to work, and in
parallel work with the G450 to work out the kinks.

The patch is below.

Set XDVICLKCTRL only on PPC, as doing this apparently introduces jitter on
the G550, at least on x86 architectures.

Signed-off-by: Paul A. Clarke <pc@us.ibm.com>
Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] char/moxa.c: fix endianess and multiple-card issues
Dirk Eibach [Sun, 27 Aug 2006 08:23:36 +0000 (01:23 -0700)] 
[PATCH] char/moxa.c: fix endianess and multiple-card issues

While testing Moxa C218T/PCI on PowerPC 405EP I found that loading firmware
using the linux kernel driver fails because calculation of the checksum is
not endianess independent in the original code.

After I fixed this I found that uploading firmware in a system with
multiple cards causes a kernel oops.  I had a look in the recent moxa
sources and found that they do some kind of locking there.  Applying this
lock fixed the problem.

Alan sayeth:

  Checksum changes are clearly correct.  Other changes is an improvement but
  not I think enough to handle malicious firmware attacks.  That said such an
  attacker has CAP_SYS_RAWIO anyway so that part is irrelevant except for
  neatness.

[akpm@osdl.org: cleanups]
Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] cpufreq: acpi-cpufreq: Ignore failure from acpi_cpufreq_early_init_acpi
Dave Jones [Sun, 27 Aug 2006 08:23:35 +0000 (01:23 -0700)] 
[PATCH] cpufreq: acpi-cpufreq: Ignore failure from acpi_cpufreq_early_init_acpi

Ignore the return value of early_init_acpi(), as it can give false error
messages.  If there is something really wrong, then register_driver will
fail cleanly with EINVAL later.

[ background: modprobe acpi-cpufreq on systems not capable of speed-scaling
  started failing with 'invalid argument', where previously it would only
  ever -ENODEV

  I'm not 100% happy with the solution. It'd be better to handle
  failure properly, but this is a low-impact change for 2.6.18
  We can always revisit doing this better in .19   --davej.]

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] revert "Drop tasklist lock in do_sched_setscheduler"
Oleg Nesterov [Sun, 27 Aug 2006 08:23:34 +0000 (01:23 -0700)] 
[PATCH] revert "Drop tasklist lock in do_sched_setscheduler"

sched_setscheduler() looks at ->signal->rlim[].  It is unsafe do
dereference ->signal unless tasklist_lock or ->siglock is held (or p ==
current).  We pin the task structure, but this can't prevent from
release_task()->__exit_signal() which sets ->signal = NULL.

Restore tasklist_lock across the setscheduler call.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] x86: Fix dmi detection of MacBookPro and iMac
Thomas Meyer [Sun, 27 Aug 2006 08:23:33 +0000 (01:23 -0700)] 
[PATCH] x86: Fix dmi detection of MacBookPro and iMac

Commit b64ef8afa58f397e1eaba2bd9ecaa6812064d464 ("[PATCH] add imacfb
documentation and detection") contained a wrong DMI_MATCH.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] mtd corruption fix
Richard Purdie [Sun, 27 Aug 2006 08:23:33 +0000 (01:23 -0700)] 
[PATCH] mtd corruption fix

Read the return value before we release the nand device otherwise the
value can become corrupted by another user of chip->ops, ultimately
resulting in filesystem corruption.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] lockdep: fix blkdev_open() warning
Peter Zijlstra [Sun, 27 Aug 2006 08:23:31 +0000 (01:23 -0700)] 
[PATCH] lockdep: fix blkdev_open() warning

On Wed, 2006-08-09 at 07:57 +0200, Rolf Eike Beer wrote:
> =============================================
> [ INFO: possible recursive locking detected ]
> ---------------------------------------------
> parted/7929 is trying to acquire lock:
>  (&bdev->bd_mutex){--..}, at: [<c105eb8d>] __blkdev_put+0x1e/0x13c
>
> but task is already holding lock:
>  (&bdev->bd_mutex){--..}, at: [<c105eec6>] do_open+0x72/0x3a8
>
> other info that might help us debug this:
> 1 lock held by parted/7929:
>  #0:  (&bdev->bd_mutex){--..}, at: [<c105eec6>] do_open+0x72/0x3a8
> stack backtrace:
>  [<c1003aad>] show_trace_log_lvl+0x58/0x15b
>  [<c100495f>] show_trace+0xd/0x10
>  [<c1004979>] dump_stack+0x17/0x1a
>  [<c102dee5>] __lock_acquire+0x753/0x99c
>  [<c102e3b0>] lock_acquire+0x4a/0x6a
>  [<c1204501>] mutex_lock_nested+0xc8/0x20c
>  [<c105eb8d>] __blkdev_put+0x1e/0x13c
>  [<c105ecc4>] blkdev_put+0xa/0xc
>  [<c105f18a>] do_open+0x336/0x3a8
>  [<c105f21b>] blkdev_open+0x1f/0x4c
>  [<c1057b40>] __dentry_open+0xc7/0x1aa
>  [<c1057c91>] nameidata_to_filp+0x1c/0x2e
>  [<c1057cd1>] do_filp_open+0x2e/0x35
>  [<c1057dd7>] do_sys_open+0x38/0x68
>  [<c1057e33>] sys_open+0x16/0x18
>  [<c1002845>] sysenter_past_esp+0x56/0x8d

OK, I'm having a look here; its all new to me so bear with me.

blkdev_open() calls
  do_open(bdev, ...,BD_MUTEX_NORMAL) and takes
    mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_NORMAL)

then something fails, and we're thrown to:

out_first: where
    if (bdev != bdev->bd_contains)
      blkdev_put(bdev->bd_contains) which is
        __blkdev_put(bdev->bd_contains, BD_MUTEX_NORMAL) which does
          mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_NORMAL) <--- lockdep trigger

When going to out_first, dbev->bd_contains is either bdev or whole, and
since we take the branch it must be whole. So it seems to me the
following patch would be the right one:

[akpm@osdl.org: compile fix]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] 1394: fix for recently added firewire patch that breaks things on ppc
Danny Tholen [Sun, 27 Aug 2006 08:23:29 +0000 (01:23 -0700)] 
[PATCH] 1394: fix for recently added firewire patch that breaks things on ppc

Recently a patch was added for preliminary suspend/resume handling on
!PPC_PMAC.  However, this broke both suspend and firewire on powerpc
because it saves the pci state after the device has already been disabled.

This moves the save state to before the pmac specific code.

Signed-off-by: Danny Tholen <obiwan@mailmij.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ben Collins <bcollins@ubuntu.com>
Cc: Jody McIntyre <scjody@modernduck.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Fix docs for fs.suid_dumpable
Alexey Dobriyan [Sun, 27 Aug 2006 08:23:28 +0000 (01:23 -0700)] 
[PATCH] Fix docs for fs.suid_dumpable

Sergey Vlasov noticed that there is not kernel.suid_dumpable, but
fs.suid_dumpable.

How KERN_SETUID_DUMPABLE ended up in fs_table[]? Hell knows...

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] tty: remove bogus call to cdev_del()
Rolf Eike Beer [Sun, 27 Aug 2006 08:23:27 +0000 (01:23 -0700)] 
[PATCH] tty: remove bogus call to cdev_del()

When cdev_add() failed there is no reason to call cdev_del().

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] rtc-s3c.c: fix time setting checks
Ben Dooks [Sun, 27 Aug 2006 08:23:27 +0000 (01:23 -0700)] 
[PATCH] rtc-s3c.c: fix time setting checks

Fix the year check on setting the time with the S3C24XX RTC driver.  Also
move the debug to before the set to see what is going on if it does fail.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] swsusp: Fix swap_type_of
Rafael J. Wysocki [Sun, 27 Aug 2006 08:23:25 +0000 (01:23 -0700)] 
[PATCH] swsusp: Fix swap_type_of

There is a bug in mm/swapfile.c#swap_type_of() that makes swsusp only be
able to use the first active swap partition as the resume device.  Fix it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Hugh Dickins <hugh@veritas.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] dm: Fix deadlock under high i/o load in raid1 setup.
Daniel Kobras [Sun, 27 Aug 2006 08:23:24 +0000 (01:23 -0700)] 
[PATCH] dm: Fix deadlock under high i/o load in raid1 setup.

On an nForce4-equipped machine with two SATA disk in raid1 setup using dmraid,
we experienced frequent deadlock of the system under high i/o load.  'cat
/dev/zero > ~/zero' was the most reliable way to reproduce them: Randomly
after a few GB, 'cp' would be left in 'D' state along with kjournald and
kmirrord.  The functions cp and kjournald were blocked in did vary, but
kmirrord's wchan always pointed to 'mempool_alloc()'.  We've seen this pattern
on 2.6.15 and 2.6.17 kernels.  http://lkml.org/lkml/2005/4/20/142 indicates
that this problem has been around even before.

So much for the facts, here's my interpretation: mempool_alloc() first tries
to atomically allocate the requested memory, or falls back to hand out
preallocated chunks from the mempool.  If both fail, it puts the calling
process (kmirrord in this case) on a private waitqueue until somebody refills
the pool.  Where the only 'somebody' is kmirrord itself, so we have a
deadlock.

I worked around this problem by falling back to a (blocking) kmalloc when
before kmirrord would have ended up on the waitqueue.  This defeats part of
the benefits of using the mempool, but at least keeps the system running.  And
it could be done with a two-line change.  Note that mempool_alloc() clears the
GFP_NOIO flag internally, and only uses it to decide whether to wait or return
an error if immediate allocation fails, so the attached patch doesn't change
behaviour in the non-deadlocking case.  Path is against current git
(2.6.18-rc4), but should apply to earlier versions as well.  I've tested on
2.6.15, where this patch makes the difference between random lockup and a
stable system.

Signed-off-by: Daniel Kobras <kobras@linux.de>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] drivers/rtc: fix rtc-s3c.c
Ben Dooks [Sun, 27 Aug 2006 08:23:22 +0000 (01:23 -0700)] 
[PATCH] drivers/rtc: fix rtc-s3c.c

In the cleanups of drivers/rtc/s3c-rtc.c, the base address for the
registers got broken.  This patch fixes that by ensuring the readb/writeb
are all prefixed with the base returned from ioremap()ing the registers.

Also fix check for valid year range, which was the wrong way around.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[DCCP]: Fix CCID3
Ian McDonald [Sun, 27 Aug 2006 06:40:50 +0000 (23:40 -0700)] 
[DCCP]: Fix CCID3

This fixes CCID3 to give much closer performance to RFC4342.

CCID3 is meant to alter sending rate based on RTT and loss.

The performance was verified against:
http://wand.net.nz/~perry/max_download.php

For example I tested with netem and had the following parameters:
Delayed Acks 1, MSS 256 bytes, RTT 105 ms, packet loss 5%.

This gives a theoretical speed of 71.9 Kbits/s. I measured across three
runs with this patch set and got 70.1 Kbits/s. Without this patchset the
average was 232 Kbits/s which means Linux can't be used for CCID3 research
properly.

I also tested with netem turned off so box just acting as router with 1.2
msec RTT. The performance with this is the same with or without the patch
at around 30 Mbit/s.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[BRIDGE] netfilter: memory corruption fix
Stephen Hemminger [Sun, 27 Aug 2006 03:28:30 +0000 (20:28 -0700)] 
[BRIDGE] netfilter: memory corruption fix

The bridge-netfilter code will overwrite memory if there is not
headroom in the skb to save the header.  This first showed up when
using Xen with sky2 driver that doesn't allocate the extra space.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sun, 27 Aug 2006 03:18:49 +0000 (20:18 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [DCCP]: Introduce dccp_rx_hist_find_entry
  [DCCP]: Introduces follows48 function
  [DCCP]: Update contact details and copyright
  [DCCP]: Fix typo
  [IPV6]: Segmentation offload not set correctly on TCP children
  [CONNECTOR]: Add userspace example code into Documentation/connector/

18 years ago[DCCP]: Introduce dccp_rx_hist_find_entry
Ian McDonald [Sun, 27 Aug 2006 02:07:36 +0000 (19:07 -0700)] 
[DCCP]: Introduce dccp_rx_hist_find_entry

This adds a new function dccp_rx_hist_find_entry.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[DCCP]: Introduces follows48 function
Ian McDonald [Sun, 27 Aug 2006 02:06:42 +0000 (19:06 -0700)] 
[DCCP]: Introduces follows48 function

This adds a new function to see if two sequence numbers follow each
other.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[DCCP]: Update contact details and copyright
Ian McDonald [Sun, 27 Aug 2006 02:01:30 +0000 (19:01 -0700)] 
[DCCP]: Update contact details and copyright

Just updating copyright and contacts

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[DCCP]: Fix typo
Ian McDonald [Sun, 27 Aug 2006 02:01:03 +0000 (19:01 -0700)] 
[DCCP]: Fix typo

This fixes a small typo in net/dccp/libs/packet_history.c

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[IPV6]: Segmentation offload not set correctly on TCP children
Stephen Hemminger [Fri, 25 Aug 2006 22:55:43 +0000 (15:55 -0700)] 
[IPV6]: Segmentation offload not set correctly on TCP children

TCP over IPV6 would incorrectly inherit the GSO settings.
This would cause kernel to send Tcp Segmentation Offload packets for
IPV6 data to devices that can't handle it. It caused the sky2 driver
to lock http://bugzilla.kernel.org/show_bug.cgi?id=7050
and the e1000 would generate bogus packets. I can't blame the
hardware for gagging if the upper layers feed it garbage.

This was a new bug in 2.6.18 introduced with GSO support.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[CONNECTOR]: Add userspace example code into Documentation/connector/
Evgeniy Polyakov [Fri, 25 Aug 2006 07:52:06 +0000 (00:52 -0700)] 
[CONNECTOR]: Add userspace example code into Documentation/connector/

I was asked several times to include userspace example code into
Documentation, so if there is no policy against it, consider attached patch
for 2.6.18. This program works with included Documentation/connector/cn_test.c
connector module.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[DISKLABEL] SUN: Fix signed int usage for sector count
Jeff Mahoney [Fri, 25 Aug 2006 22:58:57 +0000 (15:58 -0700)] 
[DISKLABEL] SUN: Fix signed int usage for sector count

The current sun disklabel code uses a signed int for the sector count.
When partitions larger than 1 TB are used, the cast to a sector_t causes
the partition sizes to be invalid:

 # cat /proc/paritions | grep sdan
   66   112 2146435072 sdan
   66   115 9223372036853660736 sdan3
   66   120 9223372036853660736 sdan8

This patch switches the sector count to an unsigned int to fix this.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[SPARC]: Small smp cleanup.
Krzysztof Helt [Fri, 25 Aug 2006 23:22:21 +0000 (16:22 -0700)] 
[SPARC]: Small smp cleanup.

It moves the smp_procesors_ready variable to sun4d_smp.c only.

Signed-off-by: Krzysztof Helt (krzysztof.h1@wp.pl)
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[SPARC]: enabling of the 2nd CPU in 2.6.18-rc4
Krzysztof Helt [Fri, 25 Aug 2006 07:46:02 +0000 (00:46 -0700)] 
[SPARC]: enabling of the 2nd CPU in 2.6.18-rc4

smp_setup_cpu_possible_map() needs to run after paging_init()
so that the in-kernel device tree is setup.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[PATCH] unusual_devs update for UCR-61S2B
Alan Stern [Mon, 14 Aug 2006 15:40:46 +0000 (11:40 -0400)] 
[PATCH] unusual_devs update for UCR-61S2B

The existing unusual_devs entry for the UCR-61S2B appears to have too
wide a revision range.  It matches at least one device that doesn't
respond to the initialization sequence.  Perhaps the sequence needs to
be updated, or perhaps something else can be done.  For now, this patch
(as764) restricts the range to include only the revision mentioned in
the original comment.

This resolves (for now!) Bugzilla entry #6950.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] USB: pl2303: removed support for OTi's DKU-5 clone cable
Tomasz Kazmierczak [Fri, 18 Aug 2006 21:43:29 +0000 (23:43 +0200)] 
[PATCH] USB: pl2303: removed support for OTi's DKU-5 clone cable

This patch removes support for a clone of Nokia DKU-5 cable made by Ours
Technology Inc, as it turned out that the cable does not use the pl2303
chip, but OTI-6858 chip which is not compatible with the pl2303.

Signed-off-by: Tomasz Kazmierczak <tomek.fizyk@op.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] USB: fix bug in cypress_cy7c63.c driver
Greg Kroah-Hartman [Tue, 15 Aug 2006 00:32:51 +0000 (17:32 -0700)] 
[PATCH] USB: fix bug in cypress_cy7c63.c driver

This was pointed out by Adrian Bunk <bunk@stusta.de>, as found by the Coverity Checker.

Cc: Adrian Bunk <bunk@stusta.de>
Cc: Oliver Bock <o.bock@fh-wolfenbuettel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] PCI: kerneldoc correction in pci-driver
Henrik Kretzschmar [Tue, 15 Aug 2006 08:57:16 +0000 (10:57 +0200)] 
[PATCH] PCI: kerneldoc correction in pci-driver

Removes an unused kerneldoc entry from pci_match_device and
put the others into correct order.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] CPCI hotplug: fix resource assignment
Scott Murray [Tue, 22 Aug 2006 23:55:57 +0000 (19:55 -0400)] 
[PATCH] CPCI hotplug: fix resource assignment

Here is a patch against the CPCI hotplug core to fix up PCI resource
assignment such that things will actually work when a hot inserted
device is enabled.  I mentioned this patch to you way back in April at
ELC, but am only now out from under things enough to clean it up and
submit it.  I've basically cribbed the corresponding code from
shpchp_pci.c, so there are no big surprises.  If it's still possible, I
wouldn't mind this going into 2.6.18, but it wouldn't be the end of the
world if it went into 2.6.19.

Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] PCI: fix ICH6 quirks
Daniel Ritz [Tue, 22 Aug 2006 14:29:10 +0000 (07:29 -0700)] 
[PATCH] PCI: fix ICH6 quirks

- add the ICH6(R) LPC to the ICH6 ACPI quirks.  currently only the ICH6-M
  is handled.  [ PCI_DEVICE_ID_INTEL_ICH6_1 is the ICH6-M LPC, ICH6_0 is
  the ICH6(R) ]

- remove the wrong quirk calling asus_hides_smbus_lpc() for ICH6.  the
  register modified in asus_hides_smbus_lpc() has a different meaning in
  ICH6.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] PCI: i386 mmconfig: don't forget bus number when setting fallback_slots bits
Daniel Ritz [Tue, 22 Aug 2006 14:29:09 +0000 (07:29 -0700)] 
[PATCH] PCI: i386 mmconfig: don't forget bus number when setting fallback_slots bits

On i386 PCI mmconfig forgets the bus number when setting the fallback_slots
bits which means fallback to conf1 only works for bus 0.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] PCI: use PCBIOS as last fallback
Daniel Ritz [Tue, 22 Aug 2006 14:29:08 +0000 (07:29 -0700)] 
[PATCH] PCI: use PCBIOS as last fallback

there was a change in 2.6.17 which affected the order in which the PCI
access methods are probed.  this gives regressions on some machines with
broken BIOS.  the problem is that PCBIOS sometimes reports last bus wrong,
leaving cardbus non-funcational.  previously those system worked fine with
direct access.

The patch changes the PCI init code to have PCBIOS as last fallback, yet
the PCBIOS code still has to run first to set pcibios_last_bus to the value
reported by the BIOS.  this is needed in case legacy PCI probing
(arch/i386/pci/legacy.c) is used to detect peer busses.  using direct
access if available fixes the cardbus problems.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] hwmon: abituguru timeout fixes
Hans de Goede [Fri, 25 Aug 2006 08:24:20 +0000 (10:24 +0200)] 
[PATCH] hwmon: abituguru timeout fixes

This patch contains 2 sets of fixes for the abituguru:
 1) Much improved timeout handling, drasticly reducing the amount of
    timeout errors on some motherboards
 2) Fix the exit paths in the bank1 sensor type detect code to always
    restore the original settings even on an error. Without this our
    special test settings could remain seriously confusing the system
    BIOS's setup menu.

Both are very much related and are must haves, to avoid messing up the
uguru CMOS settings.

Detailed changes:
- Much improved timeout / wait for status handling. Many thanks to Sunil
  Kumar, for all his testing, ideas and patches! The code now first busy
  waits, polling the uguru for the expected status as this usually
  succeeds pretty quickly (within 90 reads). To avoid unnecessary CPU burn
  in timeout conditions, the amount of busy waiting has been halved from
  previous versions (120 tries instead of 250). This is not a problem,
  because this version goes to sleep after 120 attemps for 1 jiffy and
  then tries again, it does this sleep and try again 5 times before
  finally giving up. This (almost?) completly removes the timeout errors
  some people have seen regulary. Apparently some older uguru versions
  sometimes are distracted for a (relatively) long time. This solves this.
- These timeout errors not only occur in the sending address part of
  reading the uguru but also in the wait for read state, so errors in
  this state are now handled as retryable just like send address state
  errors and are only logged and reported to userspace if 3 executive
  tries fail.
- Fix a very nasty bug in the bank1 sensor type detection code, where it
  would not restore the original settings in any of the error paths!
- Since not successfully restoring the original settings can seriously
  confuse the system BIOS (hang when entering the relevant setup menu),
  we now try restoring them 3 times before giving up.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years ago[PATCH] i2c: tps65010 build fixes
David Brownell [Fri, 11 Aug 2006 20:53:08 +0000 (22:53 +0200)] 
[PATCH] i2c: tps65010 build fixes

The tps65010.c driver in the main tree never got updated with
build fixes since the last batch of I2C driver changes; and the
genirq trigger flags were updated wierdly too.

This also includes a minor tweak to reduce the frequency used to
poll for unplug-the-AC-power on the TPS chips that don't provide
relevant IRQs.  It _would_ be nice to sense whether there's even
a battery, but that'd normally be an HDQ/1-wire interface to a
smart battery, and such APIs aren't standardized.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoMerge gregkh@master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Greg Kroah-Hartman [Sat, 26 Aug 2006 20:04:23 +0000 (13:04 -0700)] 
Merge gregkh@/linux/kernel/git/jejb/scsi-rc-fixes-2.6

18 years ago[SCSI] fix scsi_send_eh_cmnd regression
Mike Christie [Sat, 26 Aug 2006 07:00:22 +0000 (03:00 -0400)] 
[SCSI] fix scsi_send_eh_cmnd regression

The callers of scsi_send_eh_cmnd are setting the cmnd buffer,
and then scsi_send_eh_cmnd is copying that updated buffer to
the old_cmnd variable. Then after the command runs, we end up
copying that old_cmnd var which has the new cmnd to the scsi
command buffer. When this command gets recent, all types of fun
things happen like getting TUR or START_STOP commands with
data and scatterlists.

This patch made against scsi-rc-fixes, has the callers of
scsi_send_eh_cmnd pass in the command so scsi_send_eh_cmnd
can do the right thing. This should go into 2.6.18 since this
fixes a regression added when we removed some of the scsi_cmnd
fields and replaced them with local variables.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18 years ago[SCSI] qla2xxx: Update version number to 8.01.07-k1.
Andrew Vasquez [Wed, 23 Aug 2006 21:54:56 +0000 (14:54 -0700)] 
[SCSI] qla2xxx: Update version number to 8.01.07-k1.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18 years ago[SCSI] qla2xxx: Properly re-enable EFT support after an ISP abort.
Andrew Vasquez [Wed, 23 Aug 2006 21:54:55 +0000 (14:54 -0700)] 
[SCSI] qla2xxx: Properly re-enable EFT support after an ISP abort.

Software must explicitely re-enable extended firmware tracing
after any ISP abort condition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18 years ago[SCSI] qla2xxx: Correct PLOGI retry logic.
Andrew Vasquez [Wed, 23 Aug 2006 21:54:54 +0000 (14:54 -0700)] 
[SCSI] qla2xxx: Correct PLOGI retry logic.

Original code attempts to retry PLOGIs to fcports that are
FCP_TARGETs only.  If the driver never performed a successful
PLOGI/PRLI, the port-type would never be assigned, and the
relogin logic would silently drop the request (and thus the port
would not be recognized and registered).

The fix is relatively straightforward, drop the FCP_TARGET-only
check.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18 years ago[SCSI] sg: fix incorrect page problem
Douglas Gilbert [Sat, 19 Aug 2006 04:11:34 +0000 (00:11 -0400)] 
[SCSI] sg: fix incorrect page problem

There's a problem where sg is executing a ->nopage operation on a
compound page, it actually calls get_page() on the first page in the
compound rather than the page which is being mapped.  The fix is to
select the correct page by indexing into the compound.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18 years agoMerge branch 'fixes' of git://git.linux-nfs.org/pub/linux/nfs-2.6
Greg Kroah-Hartman [Fri, 25 Aug 2006 05:29:46 +0000 (22:29 -0700)] 
Merge branch 'fixes' of git://git.linux-nfs.org/pub/linux/nfs-2.6

18 years agoVFS: Remove redundant open-coded mode bit checks in open_exec().
Trond Myklebust [Wed, 23 Aug 2006 00:06:04 +0000 (20:06 -0400)] 
VFS: Remove redundant open-coded mode bit checks in open_exec().

The check in open_exec() for inode->i_mode & 0111 has been made
redundant by the fix to permission().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 1d3741c5d991686699f100b65b9956f7ee7ae0ae commit)

18 years agoVFS: Remove redundant open-coded mode bit check in prepare_binfmt().
Trond Myklebust [Wed, 23 Aug 2006 00:06:03 +0000 (20:06 -0400)] 
VFS: Remove redundant open-coded mode bit check in prepare_binfmt().

The check in prepare_binfmt() for inode->i_mode & 0111 is redundant,
since open_exec() will already have done that.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 822dec482ced07af32c378cd936d77345786572b commit)

18 years agoVFS: Fix access("file", X_OK) in the presence of ACLs
Trond Myklebust [Wed, 23 Aug 2006 00:06:03 +0000 (20:06 -0400)] 
VFS: Fix access("file", X_OK) in the presence of ACLs

Currently, the access() call will return incorrect information on NFS if
there exists an ACL that grants execute access to the user on a regular
file. The reason the information is incorrect is that the VFS overrides
this execute access in open_exec() by checking (inode->i_mode & 0111).

This patch propagates the VFS execute bit check back into the generic
permission() call.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 64cbae98848c4c99851cb0a405f0b4982cd76c1e commit)

18 years agoNFSv4: Add v4 exception handling for the ACL functions.
Trond Myklebust [Thu, 24 Aug 2006 16:27:15 +0000 (12:27 -0400)] 
NFSv4: Add v4 exception handling for the ACL functions.

This is needed in order to handle any NFS4ERR_DELAY errors that might be
returned by the server. It also ensures that we map the NFSv4 errors before
they are returned to userland.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 71c12b3f0abc7501f6ed231a6d17bc9c05a238dc commit)

18 years agoNFS: Check lengths more thoroughly in NFS4 readdir XDR decode
David Howells [Thu, 24 Aug 2006 19:44:19 +0000 (15:44 -0400)] 
NFS: Check lengths more thoroughly in NFS4 readdir XDR decode

Check the bounds of length specifiers more thoroughly in the XDR decoding of
NFS4 readdir reply data.

Currently, if the server returns a bitmap or attr length that causes the
current decode point pointer to wrap, this could go undetected (consider a
small "negative" length on a 32-bit machine).

Also add a check into the main XDR decode handler to make sure that the amount
of data is a multiple of four bytes (as specified by RFC-1014).  This makes
sure that we can do u32* pointer subtraction in the NFS client without risking
an undefined result (the result is undefined if the pointers are not correctly
aligned with respect to one another).

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 5861fddd64a7eaf7e8b1a9997455a24e7f688092 commit)

18 years agoNFSv4: increase client-provided nfs4 clientid size
J. Bruce Fields [Thu, 24 Aug 2006 19:44:12 +0000 (15:44 -0400)] 
NFSv4: increase client-provided nfs4 clientid size

Neil Brown observed that the current limit of 32 bytes isn't enough to hold two
ip addresses and the rest of the stuff we're putting in it, so it's often
truncated to the point where it's unlikely to be unique.  This can cause
spurious CLID_INUSE's from the server.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from fc8c17ec251e984ab3df9182ed097aa5b577c915 commit)

18 years agoSUNRPC: avoid choosing an IPMI port for RPC traffic
Chuck Lever [Wed, 23 Aug 2006 00:06:15 +0000 (20:06 -0400)] 
SUNRPC: avoid choosing an IPMI port for RPC traffic

Some hardware uses port 664 for its hardware-based IPMI listener.  Teach
the RPC client to avoid using that port by raising the default minimum port
number to 665.

Test plan:
Find a mainboard known to use port 664 for IPMI; enable IPMI; mount NFS
servers in a tight loop.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 58e8cb3a035d22fc386e1c53a5d98c3f219530fb commit)

18 years agoNFS: Fix issue with EIO on NFS read
Trond Myklebust [Tue, 22 Aug 2006 17:44:32 +0000 (13:44 -0400)] 
NFS: Fix issue with EIO on NFS read

The problem is that we may be caching writes that would extend the file and
create a hole in the region that we are reading. In this case, we need to
detect the eof from the server, ensure that we zero out the pages that
are part of the hole and mark them as up to date.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 856b603b01b99146918c093969b6cb1b1b0f1c01 commit)

18 years agoLOCKD: Fix a deadlock in nlm_traverse_files()
Trond Myklebust [Thu, 10 Aug 2006 15:58:57 +0000 (11:58 -0400)] 
LOCKD: Fix a deadlock in nlm_traverse_files()

nlm_traverse_files() is not allowed to hold the nlm_file_mutex while calling
nlm_inspect file, since it may end up calling nlm_release_file() when
releaseing the blocks.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from e558d3cde986e04f68afe8c790ad68ef4b94587a commit)

18 years agoSUNRPC: Fix dentry refcounting issues with users of rpc_pipefs
Trond Myklebust [Mon, 14 Aug 2006 17:11:15 +0000 (13:11 -0400)] 
SUNRPC: Fix dentry refcounting issues with users of rpc_pipefs

rpc_unlink() and rpc_rmdir() will dput the dentry reference for you.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from a05a57effa71a1f67ccbfc52335c10c8b85f3f6a commit)

18 years agoSUNRPC: rpc_unlink() must check for unhashed dentries
Trond Myklebust [Thu, 10 Aug 2006 21:51:46 +0000 (17:51 -0400)] 
SUNRPC: rpc_unlink() must check for unhashed dentries

A prior call to rpc_depopulate() by rpc_rmdir() on the parent directory may
have already called simple_unlink() on this entry.
Add the same check to rpc_rmdir(). Also remove a redundant call to
rpc_close_pipes() in rpc_rmdir.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 0bbfb9d20f6437c4031aa3bf9b4d311a053e58e3 commit)

18 years agoNFS: clean up rpc_rmdir
Trond Myklebust [Mon, 31 Jul 2006 21:17:18 +0000 (14:17 -0700)] 
NFS: clean up rpc_rmdir

Make it take a dentry argument instead of a path

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 648d4116eb2509f010f7f34704a650150309b3e7 commit)

18 years agoSUNRPC: make rpc_unlink() take a dentry argument instead of a path
Trond Myklebust [Mon, 31 Jul 2006 21:11:48 +0000 (14:11 -0700)] 
SUNRPC: make rpc_unlink() take a dentry argument instead of a path

Signe-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 88bf6d811b01a4be7fd507d18bf5f1c527989089 commit)

18 years agoVFS: add lookup hint for network file systems
ASANO Masahiro [Wed, 23 Aug 2006 00:06:02 +0000 (20:06 -0400)] 
VFS: add lookup hint for network file systems

I'm trying to speeding up mkdir(2) for network file systems.  A typical
mkdir(2) calls two inode_operations: lookup and mkdir.  The lookup
operation would fail with ENOENT in common case.  I think it is unnecessary
because the subsequent mkdir operation can check it.  In case of creat(2),
lookup operation is called with the LOOKUP_CREATE flag, so individual
filesystem can omit real lookup.  e.g.  nfs_lookup().

Here is a sample patch which uses LOOKUP_CREATE and O_EXCL on mkdir,
symlink and mknod.  This uses the gadget for creat(2).

And here is the result of a benchmark on NFSv3.
  mkdir(2) 10,000 times:
    original  50.5 sec
    patched   29.0 sec

Signed-off-by: ASANO Masahiro <masano@tnes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from fab7bf44449b29f9d5572a5dd8adcf7c91d5bf0f commit)

18 years agoNFS: Fix a potential deadlock in nfs_release_page
Nikita Danilov [Wed, 9 Aug 2006 17:53:47 +0000 (13:53 -0400)] 
NFS: Fix a potential deadlock in nfs_release_page

nfs_wb_page() waits on request completion and, as a result, is not safe to be
called from nfs_release_page() invoked by VM scanner as part of GFP_NOFS
allocation. Fix possible deadlock by analyzing gfp mask and refusing to
release page if __GFP_FS is not set.

Signed-off-by: Nikita Danilov <danilov@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 374d969debfb290bafcb41d28918dc6f7e43ce31 commit)

18 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Greg Kroah-Hartman [Thu, 24 Aug 2006 17:54:22 +0000 (10:54 -0700)] 
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

18 years ago[S390] dasd PAV enabling.
Horst Hummel [Thu, 24 Aug 2006 11:22:36 +0000 (13:22 +0200)] 
[S390] dasd PAV enabling.

The subsystem check in the PAV code is incorrect, it enables PAV
per device instead of per subsystem.

Signed-off-by: Horst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
18 years agoMerge branch 'upstream-greg' of gregkh@master.kernel.org:/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Thu, 24 Aug 2006 08:28:14 +0000 (01:28 -0700)] 
Merge branch 'upstream-greg' of gregkh@/linux/kernel/git/jgarzik/libata-dev

18 years ago[PATCH] sata_via: use old SCR access pattern on vt6420
Tejun Heo [Tue, 22 Aug 2006 16:00:27 +0000 (01:00 +0900)] 
[PATCH] sata_via: use old SCR access pattern on vt6420

vt6420 has super-fragile SCR registers which can hang the whole
machine if accessed with the wrong timings.  This patch makes sata_via
use SCR registers only during probing and with the same timings as
before (pre new EH), which is proven to work.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years ago[PATCH] ata_piix: implement force_pcs module parameter
Tejun Heo [Tue, 22 Aug 2006 12:15:58 +0000 (21:15 +0900)] 
[PATCH] ata_piix: implement force_pcs module parameter

This patch implements force_pcs module parameter for ata_piix.  If 1,
PCS is ignored, 2 honored.  As there seem to be quite a few ICHs w/
impaired PCS, this option will be useful for cases where the default
setting doesn't work.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years ago[PATCH] ata_piix: ignore PCS on ICH5
Tejun Heo [Tue, 22 Aug 2006 12:06:46 +0000 (21:06 +0900)] 
[PATCH] ata_piix: ignore PCS on ICH5

There have been a number of reports regarding some ICH5s failing to
detect devices since the PCS handling update.  Analysis shows that
these problems are caused by bogus PCS values from those controllers.

Before the PCS update, the driver didn't honor PCS regs exactly and
probed them in many cases PCS reports no device.  Now that PCS is
honored exactly, these hardware problems are visible.

This patch makes ICH5 ignore PCS.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years agoMerge branch 'upstream-greg' of gregkh@master.kernel.org:/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Thu, 24 Aug 2006 04:58:48 +0000 (21:58 -0700)] 
Merge branch 'upstream-greg' of gregkh@/linux/kernel/git/jgarzik/netdev-2.6

18 years agoMerge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
Jeff Garzik [Thu, 24 Aug 2006 04:41:25 +0000 (00:41 -0400)] 
Merge branch 'upstream-fixes' of git://git./linux/kernel/git/linville/wireless-2.6 into upstream-fixes

18 years ago[PATCH] spectrum_cs: Fix firmware uploading errors
Richard Purdie [Tue, 22 Aug 2006 17:55:44 +0000 (18:55 +0100)] 
[PATCH] spectrum_cs: Fix firmware uploading errors

spectrum_cs: Fix the logic so we error when the device is *not* present!

This fixes firmware upload failures which prevent the driver from
working (the bug is also present in 2.6.17).

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years ago[PATCH] pcnet32: break in 2.6.18-rc1 identified
Don Fry [Tue, 22 Aug 2006 17:22:37 +0000 (10:22 -0700)] 
[PATCH] pcnet32: break in 2.6.18-rc1 identified

A change I made for 2.6.17 and another for 2.6.18 do not work on older
pcnet32 chips which I do not have access to.  If the chip is a 79C970 or
79C965, do not try and suspend or check the link status.
I have tested with a 79C970A, 79C971, 79C972, 79C973, 79C975, 79C976,
and 79C978.

Signed-off-by: Don Fry <brazilnut@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years ago[PATCH] xirc2ps_cs: Cannot reset card in atomic context
Joerg Ahrens [Sun, 20 Aug 2006 20:51:57 +0000 (21:51 +0100)] 
[PATCH] xirc2ps_cs: Cannot reset card in atomic context

I am using a Xircom CEM33 pcmcia NIC which has occasional hardware problems.
If the netdev watchdog detects a transmit timeout, do_reset is called which
msleeps - this is illegal in atomic context.

This patch schedules the timeout handling as a workqueue item.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years ago[PATCH] Signedness issue in drivers/net/3c515.c
Eric Sesterhenn [Sat, 19 Aug 2006 17:37:57 +0000 (19:37 +0200)] 
[PATCH] Signedness issue in drivers/net/3c515.c

while playing with gcc 4.1 -Wextra warnings, I came across this one:

drivers/net/3c515.c:1027: warning: comparison of unsigned expression >= 0 is always true

Since i is unsigned the >= 0 check in the for loop is always true,
so we might spin there forever unless the if condition triggers.
Since i is only used in this loop, this patch changes it to
an integer.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
18 years agoMerge branch 'for-linus' of gregkh@master.kernel.org:/pub/scm/linux/kernel/git/dtor...
Greg Kroah-Hartman [Thu, 24 Aug 2006 04:11:56 +0000 (21:11 -0700)] 
Merge branch 'for-linus' of gregkh@/linux/kernel/git/dtor/input

18 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Greg Kroah-Hartman [Thu, 24 Aug 2006 04:08:12 +0000 (21:08 -0700)] 
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

18 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Greg Kroah-Hartman [Thu, 24 Aug 2006 01:08:44 +0000 (18:08 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

18 years ago[POWERPC] hugepage BUG fix
Adam Litke [Fri, 18 Aug 2006 18:22:21 +0000 (11:22 -0700)] 
[POWERPC] hugepage BUG fix

On Tue, 2006-08-15 at 08:22 -0700, Dave Hansen wrote:
> kernel BUG in cache_free_debugcheck at mm/slab.c:2748!

Alright, this one is only triggered when slab debugging is enabled.  The
slabs are assumed to be aligned on a HUGEPTE_TABLE_SIZE boundary.  The free
path makes use of this assumption and uses the lowest nibble to pass around
an index into an array of kmem_cache pointers.  With slab debugging turned
on, the slab is still aligned, but the "working" object pointer is not.
This would break the assumption above that a full nibble is available for
the PGF_CACHENUM_MASK.

The following patch reduces PGF_CACHENUM_MASK to cover only the two least
significant bits, which is enough to cover the current number of 4 pgtable
cache types.  Then use this constant to mask out the appropriate part of
the huge pte pointer.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[SERIAL] sunzilog: Mirror the sunsab serial setup bug fix.
David S. Miller [Wed, 23 Aug 2006 22:53:39 +0000 (15:53 -0700)] 
[SERIAL] sunzilog: Mirror the sunsab serial setup bug fix.

Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[SERIAL] sunsab: Fix E250 console with RSC.
Marc Zyngier [Wed, 23 Aug 2006 22:50:57 +0000 (15:50 -0700)] 
[SERIAL] sunsab: Fix E250 console with RSC.

This fixes yet another sunsab problem, when console is set to anything
but the first port. The console framework calls sunsab_console_setup
for each port, and we end up setting up a console on a not yet
discovered port, which leads to an Oops. Instead, defer console setup
until the requested port is properly initialized. Tested on an E250
through an RSC console.

Reported by Daniel Smolik <marvin@mydatex.cz>

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
18 years ago[SCSI] esp: Fix build on SUN4.
David S. Miller [Wed, 23 Aug 2006 22:33:07 +0000 (15:33 -0700)] 
[SCSI] esp: Fix build on SUN4.

Noted by Alexey Dobriyan.

Signed-off-by: David S. Miller <davem@davemloft.net>
18 years agoIB/mthca: Update HCA firmware revisions
Michael S. Tsirkin [Tue, 22 Aug 2006 19:45:06 +0000 (22:45 +0300)] 
IB/mthca: Update HCA firmware revisions

Update the driver's list of HCA firmware revisions to make sure people
running Sinai firmware older than 1.1.0 get a message suggesting a
firmware upgrade.  Update the Arbel versions as well while we are at it.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
18 years ago[PATCH] hostap: Restore antenna selection settings after port reset
Pavel Roskin [Wed, 16 Aug 2006 01:41:39 +0000 (21:41 -0400)] 
[PATCH] hostap: Restore antenna selection settings after port reset

Intersil firmware 1.7.4 (and possibly others) loses the antenna
selection settings when the port is reset.

Signed-off-by: David Acker <dacker@roinet.com>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
18 years ago[PATCH] spectrum_cs: Fix incorrect use of pcmcia_dev_present()
Pavel Roskin [Wed, 16 Aug 2006 00:42:20 +0000 (20:42 -0400)] 
[PATCH] spectrum_cs: Fix incorrect use of pcmcia_dev_present()

This bug was introduced during the PCMCIA API conversion and broke
spectrum_cs completely.

Tracked down by Fredrik Tolf <fredrik@dolda2000.com>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
18 years ago[POWERPC] Fix compile problem without CONFIG_PCI
Li Yang [Wed, 23 Aug 2006 06:13:08 +0000 (14:13 +0800)] 
[POWERPC] Fix compile problem without CONFIG_PCI

Compile fails without defining CONFIG_PCI.
The patch fix this.

[paulus@samba.org: Moved of_irq_pci_swizzle so we only need one #ifdef]

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[POWERPC] Correct masks used in emulating some instructions
Paul Mackerras [Wed, 23 Aug 2006 06:58:39 +0000 (16:58 +1000)] 
[POWERPC] Correct masks used in emulating some instructions

When we get an illegal instruction exception, we check to see whether
the instruction is one that we emulate for the user program.  Some of
the masks we use in checking whether the offending instruction is one
we care about didn't have the top bit set, which is the MSB of the
major opcode.  Thus some undefined opcodes could get emulated as other
(defined but unimplemented) instructions.  This corrects the masks.

Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[POWERPC] Pass UPIO_TSI flag to 8259 serial driver
Zang Roy-r61911 [Wed, 23 Aug 2006 02:20:27 +0000 (10:20 +0800)] 
[POWERPC] Pass UPIO_TSI flag to 8259 serial driver

The patch passes the UPIO_TSI flag to general 8259 serial driver

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[POWERPC] Update mpc7448hpc2 board irq support using device tree
Zang Roy-r61911 [Wed, 23 Aug 2006 02:19:50 +0000 (10:19 +0800)] 
[POWERPC] Update mpc7448hpc2 board irq support using device tree

The patch rewrites mpc7448hpc2 board irq support according to the new
mpic device tree interface.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[POWERPC] Fix BootX booting with an initrd
Benjamin Herrenschmidt [Wed, 23 Aug 2006 01:45:12 +0000 (11:45 +1000)] 
[POWERPC] Fix BootX booting with an initrd

The bootx_init.c trampoline didn't properly add the ramdisk to the
"reserve map" (list of reserved areas of memory), thus causing all sorts
of failures when using BootX with an initrd. Also fixes a possible
problem if the ramdisk is located before the device-tree passed by
BootX.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
18 years ago[POWERPC] Fix gettimeofday inaccuracies
Nathan Lynch [Wed, 23 Aug 2006 01:36:05 +0000 (20:36 -0500)] 
[POWERPC] Fix gettimeofday inaccuracies

There are two problems in the powerpc gettimeofday code which can
cause incorrect results to be returned.

The first is that there is a race between do_gettimeofday and the
timer interrupt:

1. do_gettimeofday does get_tb()

2. decrementer exception on boot cpu which runs timer_recalc_offset,
   which also samples the timebase and updates the do_gtod structure
   with a greater timebase value.

3. do_gettimeofday calls __do_gettimeofday, which leads to the
   negative result from tb_val - temp_varp->tb_orig_stamp.

The second is caused by taking the boot cpu offline, which can cause
the value of tb_last_jiffy to be increased past the currently
available timebase, causing the same underflow as above.

[paulus@samba.org - define and use data_barrier() instead of mb().]

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>