safe/jmp/linux-2.6
14 years agonet: restore the original spinlock to protect unicast list
Jiri Pirko [Thu, 30 Jul 2009 01:06:12 +0000 (01:06 +0000)]
net: restore the original spinlock to protect unicast list

There is a path when an assetion in dev_unicast_sync() appears.

igmp6_group_added -> dev_mc_add -> __dev_set_rx_mode ->
-> vlan_dev_set_rx_mode -> dev_unicast_sync

Therefore we cannot protect this list with rtnl. This patch restores the
original protecting this list with spinlock.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix coherent dma mask setting
Dhananjay Phadke [Sat, 1 Aug 2009 21:36:16 +0000 (21:36 +0000)]
netxen: fix coherent dma mask setting

Change default dma mask for NX3031 to 39 bit with ability
to update it to 64-bit (if firmware indicates support). Old
code was restricting it under 4GB (32-bit), sometimes causing
failure to allocate descriptor rings on heavily populated
system. NX2031 based NICs will still get 32-bit coherent mask.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomISDN: Read buffer overflow
roel kluin [Fri, 31 Jul 2009 03:43:59 +0000 (03:43 +0000)]
mISDN: Read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos6gmac: Read buffer overflow
roel kluin [Sat, 1 Aug 2009 20:20:13 +0000 (20:20 +0000)]
s6gmac: Read buffer overflow

Check whether index is within bounds before testing the element.
In the last iteration i is PHY_MAX_ADDR. the condition
`!(p = pd->mii.bus->phy_map[PHY_MAX_ADDR])' is undefined and may
evaluate to false, which leads to a dereference of this invalid
phy_map in the phy_connect() below.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotulip: Read buffer overflow
roel kluin [Sat, 1 Aug 2009 20:26:52 +0000 (20:26 +0000)]
tulip: Read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: net_assign_generic() fix
Eric Dumazet [Tue, 28 Jul 2009 02:36:15 +0000 (02:36 +0000)]
net: net_assign_generic() fix

memcpy() should take into account size of pointers,
not only number of pointers to copy.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopppol2tp: calls unregister_pernet_gen_device() at unload time
Eric Dumazet [Tue, 28 Jul 2009 03:47:39 +0000 (03:47 +0000)]
pppol2tp: calls unregister_pernet_gen_device() at unload time

Failure to call unregister_pernet_gen_device() can exhaust memory
if module is loaded/unloaded many times.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoppp: fix lost fragments in ppp_mp_explode() (resubmit)
Ben McKeegan [Tue, 28 Jul 2009 07:43:57 +0000 (07:43 +0000)]
ppp: fix lost fragments in ppp_mp_explode() (resubmit)

This patch fixes the corner cases where the sum of MTU of the free
channels (adjusted for fragmentation overheads) is less than the MTU
of PPP link.  There are at least 3 situations where this case might
arise:

- some of the channels are busy

- the multilink session is running in a degraded state (i.e. with less
than its full complement of active channels)

- by design, where multilink protocol is being used to artificially
increase the effective link MTU of a single link.

Without this patch, at most 1 fragment is ever sent per free channel
for a given PPP frame and any remaining part of the PPP frame that
does not fit into those fragments is silently discarded.

This patch restores the original behaviour which was broken by commit
9c705260feea6ae329bc6b6d5f6d2ef0227eda0a 'ppp:ppp_mp_explode()
redesign'.  Once all 'free' channels have been given a fragment, an
additional fragment is queued to each available channel in turn, as many
times as necessary, until the entire PPP frame has been consumed.

Signed-off-by: Ben McKeegan <ben@netservers.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'misc-2.6.31' into release
Len Brown [Sun, 2 Aug 2009 16:55:51 +0000 (12:55 -0400)]
Merge branch 'misc-2.6.31' into release

14 years agoMerge branch 'bugzilla-13825' into release
Len Brown [Sun, 2 Aug 2009 16:36:01 +0000 (12:36 -0400)]
Merge branch 'bugzilla-13825' into release

14 years agoeeepc-laptop: fix hot-unplug on resume
Alan Jenkins [Mon, 29 Jun 2009 08:40:07 +0000 (09:40 +0100)]
eeepc-laptop: fix hot-unplug on resume

OOPS on resume when the wireless adaptor is disabled during suspend was
introduced by "eeepc-laptop: read rfkill soft-blocked state on resume".

Unable to handle kernel NULL pointer dereference

Process s2disk
Tainted: G W
IP: klist_put

Call trace:
? klist_del
? device_del
? device_unregister
? pci_stop_dev
? pci_stop_bus
? pci_remove_device
? eeepc_rfkill_hotplug [eeepc_laptop]
? eeepc_hotk_resume [eeepc_laptop]
? acpi_device_resume
? device_resume
? hibernation_snapshot

It appears the PCI device is removed twice.  The eeepc_rfkill_hotplug()
call from the resume handler is racing against the call from the ACPI
notifier callback.  The ACPI notification is triggered by the resume
handler when it refreshes the value of CM_ASL_WLAN.

The fix is to serialize hotplug calls using a workqueue.

http://bugzilla.kernel.org/show_bug.cgi?id=13825

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoMerge branch 'memhotplug-crash' into release
Len Brown [Sun, 2 Aug 2009 16:27:26 +0000 (12:27 -0400)]
Merge branch 'memhotplug-crash' into release

14 years agoACPI: Ingore the memory block with zero block size in course of memory hotplug
Zhao Yakui [Tue, 7 Jul 2009 02:56:11 +0000 (10:56 +0800)]
ACPI: Ingore the memory block with zero block size in course of memory hotplug

If the memory block size is zero, ignore it and don't do the memory hotplug
flowchart. Otherwise it will complain the following warning message:
  >System RAM resource 0 - ffffffffffffffff cannot be added

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoACPI: Don't treat generic error as ACPI error code in acpi memory hotplug driver
Zhao Yakui [Fri, 3 Jul 2009 02:49:03 +0000 (10:49 +0800)]
ACPI: Don't treat generic error as ACPI error code in acpi memory hotplug driver

Don't treat the generic error as ACPI error code. Otherwise when the generic
code is returned, it will complain the following warning messag:
   >ACPI Exception (acpi_memhotplug-0171): UNKNOWN_STATUS_CODE,
Cannot get acpi bus device [20080609]
   >ACPI: Cannot find driver data
   > ACPI Error (utglobal-0127): Unknown exception code: 0xFFFFFFED [20080609]
   > Pid: 85, comm: kacpi_notify Not tainted 2.6.27.19-5-default #1
     Call Trace:
     [<ffffffff8020da29>] show_trace_log_lvl+0x41/0x58
     [<ffffffff8049a3da>] dump_stack+0x69/0x6f
    .....

At the same time when the generic error code is returned, the ACPI_EXCEPTION
is replaced by the printk.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoMerge branch 'bugzilla-13751' into release
Len Brown [Sun, 2 Aug 2009 16:10:02 +0000 (12:10 -0400)]
Merge branch 'bugzilla-13751' into release

14 years agoACPI: bind workqueues to CPU 0 to avoid SMI corruption
Bjorn Helgaas [Wed, 29 Jul 2009 21:54:25 +0000 (15:54 -0600)]
ACPI: bind workqueues to CPU 0 to avoid SMI corruption

On some machines, a software-initiated SMI causes corruption unless the
SMI runs on CPU 0.  An SMI can be initiated by any AML, but typically it's
done in GPE-related methods that are run via workqueues, so we can avoid
the known corruption cases by binding the workqueues to CPU 0.

References:
    http://bugzilla.kernel.org/show_bug.cgi?id=13751
    https://bugs.launchpad.net/bugs/157171
    https://bugs.launchpad.net/bugs/157691

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoMerge branch 'thinkpad' into release
Len Brown [Sun, 2 Aug 2009 15:34:24 +0000 (11:34 -0400)]
Merge branch 'thinkpad' into release

14 years agoMerge branch 'bugzilla-13865' into release
Len Brown [Sun, 2 Aug 2009 15:33:01 +0000 (11:33 -0400)]
Merge branch 'bugzilla-13865' into release

14 years agoMerge branch 'bugzilla-13620-revert' into release
Len Brown [Sun, 2 Aug 2009 15:31:32 +0000 (11:31 -0400)]
Merge branch 'bugzilla-13620-revert' into release

14 years agoACPI: root-only read protection on /sys/firmware/acpi/tables/*
Len Brown [Thu, 30 Jul 2009 20:00:53 +0000 (16:00 -0400)]
ACPI: root-only read protection on /sys/firmware/acpi/tables/*

they were world readable.

Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoparisc: hppb.c - fix printk format strings
Helge Deller [Sun, 2 Aug 2009 13:42:39 +0000 (15:42 +0200)]
parisc: hppb.c - fix printk format strings

Fix those warnings:
drivers/parisc/hppb.c: In function 'hppb_probe':
drivers/parisc/hppb.c:65: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'resource_size_t'
drivers/parisc/hppb.c:77: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'resource_size_t'
drivers/parisc/hppb.c:77: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: parisc-agp.c - use correct page_mask function
Helge Deller [Sun, 2 Aug 2009 13:35:43 +0000 (15:35 +0200)]
parisc: parisc-agp.c - use correct page_mask function

Fix those compiler warnings, which indeed point to a bug:
drivers/char/agp/parisc-agp.c:228: warning: initialization from incompatible pointer type
drivers/char/agp/parisc-agp.c:201: warning: 'parisc_agp_page_mask_memory' defined but not used

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: sticore.c - check return values
Helge Deller [Sun, 2 Aug 2009 13:26:51 +0000 (15:26 +0200)]
parisc: sticore.c - check return values

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agonilfs2: fix missing unlock in error path of nilfs_mdt_write_page
Ryusuke Konishi [Sun, 2 Aug 2009 08:45:55 +0000 (17:45 +0900)]
nilfs2: fix missing unlock in error path of nilfs_mdt_write_page

This adds a missing unlock of nilfs->ns_writer_mutex in
nilfs_mdt_write_page() function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
14 years agoparisc: dino.c - check return value of pci_assign_resource()
Helge Deller [Sun, 2 Aug 2009 13:17:37 +0000 (15:17 +0200)]
parisc: dino.c - check return value of pci_assign_resource()

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: hp_sdc_mlc.c - check return value of down_trylock()
Helge Deller [Sun, 2 Aug 2009 13:13:29 +0000 (15:13 +0200)]
parisc: hp_sdc_mlc.c - check return value of down_trylock()

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agosched: Fix race in cpupri introduced by cpumask_var changes
Gregory Haskins [Thu, 30 Jul 2009 14:57:28 +0000 (10:57 -0400)]
sched: Fix race in cpupri introduced by cpumask_var changes

Background:

Several race conditions in the scheduler have cropped up
recently, which Steven and I have tracked down using ftrace.
The most recent one turns out to be a race in how the scheduler
determines a suitable migration target for RT tasks, introduced
recently with commit:

    commit 68e74568fbe5854952355e942acca51f138096d9
    Date:   Tue Nov 25 02:35:13 2008 +1030

        sched: convert struct cpupri_vec cpumask_var_t.

The original design of cpupri allowed lockless readers to
quickly determine a best-estimate target.  Races between the
pri_active bitmap and the vec->mask were handled in the
original code because we would detect and return "0" when this
occured.  The design was predicated on the *effective*
atomicity (*) of caching the result of cpus_and() between the
cpus_allowed and the vec->mask.

Commit 68e74568 changed the behavior such that vec->mask is
accessed multiple times.  This introduces a subtle race, the
result of which means we can have a result that returns "1",
but with an empty bitmap.

*) yes, we know cpus_and() is not a locked operator across the
   entire composite array, but it is implicitly atomic on a
   per-word basis which is all the design required to work.

Implementation:

Rather than forgoing the lockless design, or reverting to a
stack-based cpumask_t, we simply check for when the race has
been encountered and continue processing in the event that the
race is hit.  This renders the removal race as if the priority
bit had been atomically cleared as well, and allows the
algorithm to execute correctly.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090730145728.25226.92769.stgit@dev.haskins.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Fix latencytop and sleep profiling vs group scheduling
Peter Zijlstra [Thu, 23 Jul 2009 18:13:26 +0000 (20:13 +0200)]
sched: Fix latencytop and sleep profiling vs group scheduling

The latencytop and sleep accounting code assumes that any
scheduler entity represents a task, this is not so.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf top: Add mwait_idle_with_hints to skip_symbols[]
Arnaldo Carvalho de Melo [Sun, 26 Jul 2009 22:06:19 +0000 (19:06 -0300)]
perf top: Add mwait_idle_with_hints to skip_symbols[]

We skip the display of idle routine related symbols because
they are typically rather erratic and confusing: they depend
on the IRQ rate or sometimes they dominate the profile if
they are polling based.

Add mwait_idle_with_hints too, this is one of the idle
routines on x86.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf tools: Fix faulty check
Stoyan Gaydarov [Thu, 30 Jul 2009 10:25:29 +0000 (05:25 -0500)]
perf tools: Fix faulty check

This patch fixes a spelling error that has resulted from copy
and pasting. The location of the error was found using a
semantic patch but the semantic patch was not trying to find
these errors. After looking things over it seemed logical that
this change was needed. Please review it and then include the
patch if it is in fact the correct change.

Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1248949529-20891-1-git-send-email-sgayda2@uiuc.edu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf report: Update for the new FORK/EXIT events
Peter Zijlstra [Thu, 23 Jul 2009 14:52:41 +0000 (16:52 +0200)]
perf report: Update for the new FORK/EXIT events

Since FORK is now also issued for threads, detect those by
comparing the parent and child PID.

Teach it about EXIT events and ignore them.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Full task tracing
Peter Zijlstra [Thu, 23 Jul 2009 12:46:33 +0000 (14:46 +0200)]
perf_counter: Full task tracing

In order to be able to distinguish between no samples due to
inactivity and no samples due to task ended, Arjan asked for
PERF_EVENT_EXIT events. This is useful to the boot delay
instrumentation (bootchart) app.

This patch changes the PERF_EVENT_FORK to be emitted on every
clone, and adds PERF_EVENT_EXIT to be emitted on task exit,
after the task's counters have been closed.

This task tracing is controlled through: attr.comm || attr.mmap
and through the new attr.task field.

Suggested-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
[ cleaned up perf_counter.h a bit ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Collapse inherit on read()
Peter Zijlstra [Fri, 24 Jul 2009 12:42:10 +0000 (14:42 +0200)]
perf_counter: Collapse inherit on read()

Currently the counter value returned by read() is the value of
the parent counter, to which child counters are only fed back
on child exit.

Thus read() can return rather erratic (and meaningless) numbers
depending on the state of the child processes.

Change this by always iterating the full child hierarchy on
read() and sum all counters.

Suggested-by: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agotracing, perf_counter: Add help text to CONFIG_EVENT_PROFILE
Peter Zijlstra [Wed, 29 Jul 2009 08:50:09 +0000 (10:50 +0200)]
tracing, perf_counter: Add help text to CONFIG_EVENT_PROFILE

Explain what tracepoint profiling sources are about.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Jeff Garzik <jeff@garzik.org>
LKML-Reference: <1248856508.6987.3041.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoparisc: includecheck fix for ccio-dma.c
Jaswinder Singh Rajput [Wed, 8 Jul 2009 15:27:20 +0000 (15:27 +0000)]
parisc: includecheck fix for ccio-dma.c

fix the following 'make includecheck' warning:

  drivers/parisc/ccio-dma.c: linux/proc_fs.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Set correct bit in protection flags
John David Anglin [Mon, 13 Jul 2009 01:44:37 +0000 (01:44 +0000)]
parisc: Set correct bit in protection flags

Signed-off-by: John David Anglin <dave@hiauly1.hia.nrc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: isa-eeprom - Fix loff_t usage
Michael Buesch [Mon, 20 Jul 2009 22:58:44 +0000 (22:58 +0000)]
parisc: isa-eeprom - Fix loff_t usage

loff_t is a signed type. If userspace passes a negative ppos, the "count"
range check is weakened. "count"s bigger than HPEE_MAX_LENGTH will pass the check.
Also, if ppos is negative, the readb(eisa_eeprom_addr + *ppos) will poke in random
memory.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: stable@kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: fixed faulty check in lba_pci
Stoyan Gaydarov [Thu, 30 Jul 2009 10:25:19 +0000 (10:25 +0000)]
parisc: fixed faulty check in lba_pci

This patche fixes a spelling error that has resulted from copy and pasting.
The location of the error was found using a semantic patch but the semantic
patch was not trying to find these errors. After looking things over it
seemed logical that this change was needed.

Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Fix read buffer overflow in pdc_stable driver
Roel Kluin [Sun, 2 Aug 2009 08:02:28 +0000 (08:02 +0000)]
parisc: Fix read buffer overflow in pdc_stable driver

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Fix GOT overflow during module load on 64bit kernel
John David Anglin [Sun, 2 Aug 2009 10:34:08 +0000 (12:34 +0200)]
parisc: Fix GOT overflow during module load on 64bit kernel

Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agothinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:20 +0000 (12:04 -0300)]
thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM

HBRV-based default selection of backlight control strategy didn't work
well, at least the X41 defines it but doesn't use it and I don't think
it will stop there.

Switch to a white/blacklist.  All models that have HBRV defined have
been included in the list, and initially all ATI GPUs will get
ECNVRAM, and the Intel GPUs will get UCMS_STEP.

Symptoms of incorrect backlight mode selection are:

1. Non-working backlight control through sysfs;

2. Backlight gets reset to the lowest level at every shutdown, reboot
   and when thinkpad-acpi gets unloaded;

This fixes a regression in 2.6.30, bugzilla #13826

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reported-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agothinkpad-acpi: restrict procfs count value to sane upper limit
Michael Buesch [Sat, 1 Aug 2009 15:04:19 +0000 (12:04 -0300)]
thinkpad-acpi: restrict procfs count value to sane upper limit

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agocifs: reinstate original behavior when uid=/gid= options are specified
Jeff Layton [Fri, 31 Jul 2009 10:56:09 +0000 (06:56 -0400)]
cifs: reinstate original behavior when uid=/gid= options are specified

This patch fixes the regression reported here:

http://bugzilla.kernel.org/show_bug.cgi?id=13861

commit 4ae1507f6d266d0cc3dd36e474d83aad70fec9e4 changed the default
behavior when the uid= or gid= option was specified for a mount. The
existing behavior was to always clobber the ownership information
provided by the server when these options were specified. The above
commit changed this behavior so that these options simply provided
defaults when the server did not provide this information (unless
"forceuid" or "forcegid" were specified)

This patch reverts this change so that the default behavior is restored.
It also adds "noforceuid" and "noforcegid" options to make it so that
ownership information from the server is preserved, even when the mount
has uid= or gid= options specified.

It also adds a couple of printk notices that pop up when forceuid or
forcegid options are specified without a uid= or gid= option.

Reported-by: Tom Chiverton <bugzilla.kernel.org@falkensweb.com>
Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agothinkpad-acpi: remove dock and bay subdrivers
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:18 +0000 (12:04 -0300)]
thinkpad-acpi: remove dock and bay subdrivers

The standard ACPI dock driver can handle the hotplug bays and docks of
the ThinkPads just fine (including batteries) as of 2.6.27, and the
code in thinkpad-acpi for the dock and bay subdrivers is currently
broken anyway...

Userspace needs some love to support the two-stage ejection nicely,
but it is simple enough to do through udev rules (you don't even need
HAL) so this wouldn't justify fixing the dock and bay subdrivers,
either.

That leaves warm-swap bays (_EJ3) support for thinkpad-acpi, as well
as support for the weird dock of the model 570, but since such support
has never left the "experimental" stage, it is also not a strong
enough reason to find a way to fix this code.

Users of ThinkPads with warm-swap bays are urged to request that _EJ3
support be added to the regular ACPI dock driver, if such feature is
indeed useful for them.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agothinkpad-acpi: disable broken bay and dock subdrivers
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:17 +0000 (12:04 -0300)]
thinkpad-acpi: disable broken bay and dock subdrivers

Currently, the ThinkPad-ACPI bay and dock drivers are completely
broken, and cause a NULL pointer derreference in kernel mode (and,
therefore, an OOPS) when they try to issue events (i.e. on dock,
undock, bay ejection, etc).

OTOH, the standard ACPI dock driver can handle the hotplug bays and
docks of the ThinkPads just fine (including batteries) as of 2.6.27.
In fact, it does a much better job of it than thinkpad-acpi ever did.

It is just not worth the hassle to find a way to fix this crap without
breaking the (deprecated) thinkpad-acpi dock/bay ABI.  This is old,
deprecated code that sees little testing or use.

As a quick fix suitable for -stable backports, mark the thinkpad-acpi
bay and dock subdrivers as BROKEN in Kconfig.  The dead code will be
removed by a later patch.

This fixes bugzilla #13669, and should be applied to 2.6.27 and later.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reported-by: Joerg Platte <jplatte@naasa.net>
Cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agodo_sigaltstack: small cleanups
Linus Torvalds [Sat, 1 Aug 2009 18:18:56 +0000 (11:18 -0700)]
do_sigaltstack: small cleanups

The previous commit ("do_sigaltstack: avoid copying 'stack_t' as a
structure to user space") fixed a real bug.  This one just cleans up the
copy from user space to that gcc can generate better code for it (and so
that it looks the same as the later copy back to user space).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodo_sigaltstack: avoid copying 'stack_t' as a structure to user space
Linus Torvalds [Sat, 1 Aug 2009 17:34:56 +0000 (10:34 -0700)]
do_sigaltstack: avoid copying 'stack_t' as a structure to user space

Ulrich Drepper correctly points out that there is generally padding in
the structure on 64-bit hosts, and that copying the structure from
kernel to user space can leak information from the kernel stack in those
padding bytes.

Avoid the whole issue by just copying the three members one by one
instead, which also means that the function also can avoid the need for
a stack frame.  This also happens to match how we copy the new structure
from user space, so it all even makes sense.

[ The obvious solution of adding a memset() generates horrid code, gcc
  does really stupid things. ]

Reported-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agonilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes
Ryusuke Konishi [Tue, 28 Jul 2009 08:55:29 +0000 (17:55 +0900)]
nilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes

Andrea Gelmini gave me a report that a kernel oops hit on a nilfs
filesystem with a 1KB block size when doing rsync.

This turned out to be caused by an inconsistency of dirty state
between a page and its buffers storing b-tree node blocks.

If the page had multiple buffers split over multiple logs, and if the
logs were written at a time, a dirty flag remained in the page even
every dirty flag in the buffers was cleared.

This will fix the failure by dropping the dirty flag properly for
pages with the discrete multiple b-tree nodes.

Reported-by: Andrea Gelmini <andrea.gelmini@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Andrea Gelmini <andrea.gelmini@gmail.com>
Cc: stable@kernel.org
14 years agoperf_counter tools: Fix link errors with older toolchains
Ingo Molnar [Sat, 1 Aug 2009 11:15:36 +0000 (13:15 +0200)]
perf_counter tools: Fix link errors with older toolchains

On older distros (F8 for example) the perf build could fail
with such missing symbols:

    LINK perf
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(bfd.o): In function `bfd_demangle':
(.text+0x2b3): undefined reference to `cplus_demangle'
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(bfd.o): In function `bfd_demangle':

Link in -liberty too.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoblock: Update topology documentation
Martin K. Petersen [Fri, 31 Jul 2009 15:49:13 +0000 (11:49 -0400)]
block: Update topology documentation

Update topology comments and sysfs documentation based upon discussions
with Neil Brown.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Stack optimal I/O size
Martin K. Petersen [Fri, 31 Jul 2009 15:49:12 +0000 (11:49 -0400)]
block: Stack optimal I/O size

When stacking block devices ensure that optimal I/O size is scaled
accordingly.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Add a wrapper for setting minimum request size without a queue
Martin K. Petersen [Fri, 31 Jul 2009 15:49:11 +0000 (11:49 -0400)]
block: Add a wrapper for setting minimum request size without a queue

Introduce blk_limits_io_min() and make blk_queue_io_min() call it.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Make blk_queue_stack_limits use the new stacking interface
Martin K. Petersen [Fri, 31 Jul 2009 15:49:10 +0000 (11:49 -0400)]
block: Make blk_queue_stack_limits use the new stacking interface

blk_queue_stack_limits() has been superceded by blk_stack_limits() and
disk_stack_limits().  Wrap the function call for now, we'll deprecate it
later.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoLinux 2.6.31-rc5 v2.6.31-rc5
Linus Torvalds [Sat, 1 Aug 2009 00:40:45 +0000 (17:40 -0700)]
Linux 2.6.31-rc5

14 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 31 Jul 2009 19:17:37 +0000 (12:17 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: bump up nr_to_write in xfs_vm_writepage
  xfs: reduce bmv_count in xfs_vn_fiemap

14 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 31 Jul 2009 19:10:26 +0000 (12:10 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  io context: fix ref counting
  block: make the end_io functions be non-GPL exports
  block: fix improper kobject release in blk_integrity_unregister
  block: always assign default lock to queues
  mg_disk: Add missing ready status check on mg_write()
  mg_disk: fix issue with data integrity on error in mg_write()
  mg_disk: fix reading invalid status when use polling driver
  mg_disk: remove prohibited sleep operation

14 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 31 Jul 2009 19:09:57 +0000 (12:09 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clocksource: Save mult_orig in clocksource_disable()

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Fri, 31 Jul 2009 19:09:22 +0000 (12:09 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: orphan subsystem
  imxmmc: Remove unnecessary semicolons
  cb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG
  sdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG
  lib/scatterlist: add a flags to signalize mapping direction

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 31 Jul 2009 19:09:02 +0000 (12:09 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: sound/aoa: Add kmalloc NULL tests
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  sound: mpu401.c: Buffer overflow
  sound: aedsp16: Buffer overflow
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555

14 years agoclocksource: Save mult_orig in clocksource_disable()
Magnus Damm [Tue, 28 Jul 2009 21:09:55 +0000 (14:09 -0700)]
clocksource: Save mult_orig in clocksource_disable()

To fix the common case where ->enable() does not set up
mult, make sure mult_orig is saved in mult on disable.

Also add comments to explain why we do this.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: johnstul@us.ibm.com
Cc: lethal@linux-sh.org
Cc: akpm@linux-foundation.org
LKML-Reference: <20090618152432.10136.9932.sendpatchset@rx1.opensource.se>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agommc: orphan subsystem
Pierre Ossman [Fri, 31 Jul 2009 10:27:28 +0000 (12:27 +0200)]
mmc: orphan subsystem

I do not have the time to take care of this, so remove myself as
maintainer.

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
14 years agoimxmmc: Remove unnecessary semicolons
Joe Perches [Sun, 28 Jun 2009 16:26:31 +0000 (09:26 -0700)]
imxmmc: Remove unnecessary semicolons

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
14 years agocb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG
Sebastian Andrzej Siewior [Mon, 22 Jun 2009 07:18:05 +0000 (09:18 +0200)]
cb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG

the code allready uses flush_kernel_dcache_page(). This patch updates the
driver to the recent sg API changes which require that either SG_MITER_TO_SG
or SG_MITER_FROM_SG is set. SG_MITER_TO_SG calls flush_kernel_dcache_page()
in sg_mitter_stop()

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
14 years agosdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG
Sebastian Andrzej Siewior [Thu, 18 Jun 2009 07:33:32 +0000 (09:33 +0200)]
sdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG

so the page will be flushed on unmap on ARCH which need it.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
14 years agolib/scatterlist: add a flags to signalize mapping direction
Sebastian Andrzej Siewior [Thu, 18 Jun 2009 08:19:12 +0000 (10:19 +0200)]
lib/scatterlist: add a flags to signalize mapping direction

sg_miter_start() is currently unaware of the direction of the copy
process (to or from the scatter list). It is important to know the
direction because the page has to be flushed in case the data written
is seen on a different mapping in user land on cache incoherent
architectures.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
14 years agoMerge branch 'fix/oss' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:45 +0000 (10:17 +0200)]
Merge branch 'fix/oss' into for-linus

* fix/oss:
  sound: mpu401.c: Buffer overflow
  sound: aedsp16: Buffer overflow

14 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:44 +0000 (10:17 +0200)]
Merge branch 'fix/misc' into for-linus

* fix/misc:
  ALSA: sound/aoa: Add kmalloc NULL tests

14 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:42 +0000 (10:17 +0200)]
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555

14 years agoALSA: sound/aoa: Add kmalloc NULL tests
Julia Lawall [Fri, 31 Jul 2009 06:32:03 +0000 (08:32 +0200)]
ALSA: sound/aoa: Add kmalloc NULL tests

Check that the result of kzalloc is not NULL before a dereference.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda - Increase PCM stream name buf in patch_realtek.c
Takashi Iwai [Fri, 31 Jul 2009 08:05:11 +0000 (10:05 +0200)]
ALSA: hda - Increase PCM stream name buf in patch_realtek.c

The name buf with size 16 is too short for some codec names, e.g.
truncated like "ALC861-VD Analo".  Now the size is doubled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoio context: fix ref counting
Li Zefan [Fri, 31 Jul 2009 06:55:48 +0000 (08:55 +0200)]
io context: fix ref counting

Commit d9c7d394a8ebacb60097b192939ae9f15235225e
("block: prevent possible io_context->refcount overflow") mistakenly
changed atomic_inc(&ioc->nr_tasks) to atomic_long_inc(&ioc->refcount).

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoxfs: bump up nr_to_write in xfs_vm_writepage
Eric Sandeen [Fri, 31 Jul 2009 05:02:17 +0000 (00:02 -0500)]
xfs: bump up nr_to_write in xfs_vm_writepage

VM calculation for nr_to_write seems off.  Bump it way
up, this gets simple streaming writes zippy again.
To be reviewed again after Jens' writeback changes.

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Cc: Chris Mason <chris.mason@oracle.com>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
14 years agoxfs: reduce bmv_count in xfs_vn_fiemap
Eric Sandeen [Mon, 27 Jul 2009 02:52:01 +0000 (21:52 -0500)]
xfs: reduce bmv_count in xfs_vn_fiemap

commit 6321e3ed2acf3ee9643cdd403e1c88605d7944ba caused
the full bmv_count's worth of getbmapx structures to get
allocated; telling it to do MAXEXTNUM was a bit insane,
resulting in ENOMEM every time.

Chop it down to something reasonable, the number of slots
in the caller's input buffer.  If this is too large the
caller may get ENOMEM but the reason should not be a
mystery, and they can try again with something smaller.

We add 1 to the value because in the normal getbmap
world, bmv_count includes the header and xfs_getbmap does:

        nex = bmv->bmv_count - 1;
        if (nex <= 0)
                return XFS_ERROR(EINVAL);

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
14 years agomd/raid6: release spare page at ->stop()
Dan Williams [Fri, 31 Jul 2009 02:39:15 +0000 (12:39 +1000)]
md/raid6: release spare page at ->stop()

Add missing call to safe_put_page from stop() by unifying open coded
raid5_conf_t de-allocation under free_conf().

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agoixgbe: Fix RSC completion delay causing Rx interrupts to stop
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:26:00 +0000 (12:26 +0000)]
ixgbe: Fix RSC completion delay causing Rx interrupts to stop

When a user disables interrupt throttling with ethtool on 82599 devices,
the interrupt timer may not be re-enabled if hardware RSC is running.  The
RSC completions in hardware don't complete before the next ITR event tries
to fire, so the ITR timer never gets re-armed.  This patch increases the
amount of time between interrupts when throttling is disabled (rx-usecs =
0) when the hardware RSC deature is enabled.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix usage of second flags bitmap when using LRO/RSC
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:25:28 +0000 (12:25 +0000)]
ixgbe: Fix usage of second flags bitmap when using LRO/RSC

A second set of feature flag bits was added, and the hardware RSC engine
flags were moved there.  However, the code itself didn't make the move
completely to use the new bitmap.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Acked-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix netpoll to be properly multiqueue aware
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:25:09 +0000 (12:25 +0000)]
ixgbe: Fix netpoll to be properly multiqueue aware

Our ndo_poll_controller callback is broken for anything but non-multiqueue
setups.  This fixes that issue.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agox86, pat: Fix set_memory_wc related corruption
Pallipadi, Venkatesh [Thu, 30 Jul 2009 21:43:19 +0000 (14:43 -0700)]
x86, pat: Fix set_memory_wc related corruption

Changeset 3869c4aa18835c8c61b44bd0f3ace36e9d3b5bd0
that went in after 2.6.30-rc1 was a seemingly small change to _set_memory_wc()
to make it complaint with SDM requirements. But, introduced a nasty bug, which
can result in crash and/or strange corruptions when set_memory_wc is used.
One such crash reported here
http://lkml.org/lkml/2009/7/30/94

Actually, that changeset introduced two bugs.
* change_page_attr_set() takes &addr as first argument and can the addr value
  might have changed on return, even for single page change_page_attr_set()
  call. That will make the second change_page_attr_set() in this routine
  operate on unrelated addr, that can eventually cause strange corruptions
  and bad page state crash.
* The second change_page_attr_set() call, before setting _PAGE_CACHE_WC, should
  clear the earlier _PAGE_CACHE_UC_MINUS, as otherwise cache attribute will not
  be WC (will be UC instead).

The patch below fixes both these problems. Sending a single patch to fix both
the problems, as the change is to the same line of code. The change to have a
addr_copy is not very clean. But, it is simpler than making more changes
through various routines in pageattr.c.

A huge thanks to Jerome for reporting this problem and providing a simple test
case that helped us root cause the problem.

Reported-by: Jerome Glisse <glisse@freedesktop.org>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <20090730214319.GA1889@linux-os.sc.intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 30 Jul 2009 23:46:58 +0000 (16:46 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing/stat: Fix seqfile memory leak
  function-graph: Fix seqfile memory leak
  trace_stack: Fix seqfile memory leak
  profile: Suppress warning about large allocations when profile=1 is specified

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
Linus Torvalds [Thu, 30 Jul 2009 23:46:48 +0000 (16:46 -0700)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: be more polite in the async caching threads
  Btrfs: preserve commit_root for async caching

14 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
Linus Torvalds [Thu, 30 Jul 2009 23:46:31 +0000 (16:46 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/djbw/async_tx

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  dmaengine: at_hdmac: add DMA slave transfers
  dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller
  dmaengine: dmatest: correct thread_count while using multiple thread per channel
  dmaengine: dmatest: add a maximum number of test iterations
  drivers/dma: Remove unnecessary semicolons
  drivers/dma/fsldma.c: Remove unnecessary semicolons
  dmaengine: move HIGHMEM64G restriction to ASYNC_TX_DMA
  fsldma: do not clear bandwidth control bits on the 83xx controller
  fsldma: enable external start for the 83xx controller
  fsldma: use PCI Read Multiple command

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Thu, 30 Jul 2009 23:46:17 +0000 (16:46 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
  udf: Fix loading of VAT inode when drive wrongly reports number of recorded blocks

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Thu, 30 Jul 2009 23:46:06 +0000 (16:46 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-quota-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6:
  quota: Silence lockdep on quota_on

14 years agoMerge git://git.infradead.org/users/cbou/battery-2.6.31
Linus Torvalds [Thu, 30 Jul 2009 23:45:53 +0000 (16:45 -0700)]
Merge git://git.infradead.org/users/cbou/battery-2.6.31

* git://git.infradead.org/users/cbou/battery-2.6.31:
  Add ds2782 battery gas gauge driver
  olpc_battery: Ensure that the TRICKLE bit is checked
  olpc_battery: Fix up eeprom read function

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
Linus Torvalds [Thu, 30 Jul 2009 23:45:37 +0000 (16:45 -0700)]
Merge git://git./linux/kernel/git/steve/gfs2-2.6-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
  GFS2: remove dcache entries for remote deleted inodes
  GFS2: Fix incorrent statfs consistency check
  GFS2: Don't put unlikely reclaim candidates on the reclaim list.
  GFS2: Don't try and dealloc own inode
  GFS2: Fix panic in glock memory shrinker
  GFS2: keep statfs info in sync on grows
  GFS2: Shrink the shrinker

14 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 30 Jul 2009 23:45:20 +0000 (16:45 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Update defconfigs for embedded 6xx/7xxx, 8xx, 8{3,5,6}xxx
  powerpc/86xx: Update GE Fanuc sbc310 default configuration
  powerpc/86xx: Update defconfig for GE Fanuc's PPC9A
  cpm_uart: Don't use alloc_bootmem in cpm_uart_cpm2.c
  powerpc/83xx: Fix PCI IO base address on MPC837xE-RDB boards
  powerpc/85xx: Don't scan for TBI PHY addresses on MPC8569E-MDS boards
  powerpc/85xx: Fix ethernet link detection on MPC8569E-MDS boards
  powerpc/mm: Fix SMP issue with MMU context handling code

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Thu, 30 Jul 2009 23:45:03 +0000 (16:45 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest and virtio: cleanup struct definitions to Linux style.
  lguest: update commentry
  lguest: fix comment style
  virtio: refactor find_vqs
  virtio: delete vq from list
  virtio: fix memory leak on device removal
  lguest: fix descriptor corruption in example launcher
  lguest: dereferencing freed mem in add_eventfd()

14 years agokprobes: Use kernel_text_address() for checking probe address
Masami Hiramatsu [Tue, 28 Jul 2009 23:47:23 +0000 (19:47 -0400)]
kprobes: Use kernel_text_address() for checking probe address

Use kernel_text_address() for checking probe address instead of
__kernel_text_address(), because __kernel_text_address() returns true
for init functions even after relaseing those functions.

That will hit a BUG() in text_poke().

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoAlan doesn't want to maintain tty code any more
Linus Torvalds [Thu, 30 Jul 2009 23:40:37 +0000 (16:40 -0700)]
Alan doesn't want to maintain tty code any more

Not that anybody can blame him.  It's a morass.  But hey, it's way
better than it _used_ to be, though, so thanks for all the fish.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogianfar: fix coalescing setup in ethtool support
Jiajun Wu [Thu, 30 Jul 2009 21:20:42 +0000 (14:20 -0700)]
gianfar: fix coalescing setup in ethtool support

Parameter order for using mk_ic_value(count, time) was reversed,
the patch fixes this.

Signed-off-by: Jiajun Wu <b06378@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopppoe: fix /proc/net/pppoe
Eric Dumazet [Tue, 28 Jul 2009 23:43:08 +0000 (23:43 +0000)]
pppoe: fix /proc/net/pppoe

If a socket is hashed in last slot of pppoe hash table (PPPOE_HASH_SIZE-1)
we report it many times (up to filling seq buffer)
(Only the last socket of last slot)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agohp-wmi: check that an input device exists in resume handler
Frans Pop [Thu, 30 Jul 2009 21:16:05 +0000 (17:16 -0400)]
hp-wmi: check that an input device exists in resume handler

Some systems may not support input events, or registering the input
handler may have failed. So check that an input device exists before
trying to set the docking and tablet mode state during resume.

Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=13865

Reported-and-tested-by: Cédric Godin <cedric@belbone.be>
Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Len Brown <len.brown@intel.com>
14 years agoeexpress: Read buffer overflow
roel kluin [Wed, 29 Jul 2009 03:18:56 +0000 (03:18 +0000)]
eexpress: Read buffer overflow

start_code is 69 words, but the code always writes a multiple of 16 words,
so the last 11 words written are outside the array.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: ARP neigh procfs buffer overflow
roel kluin [Wed, 29 Jul 2009 23:46:59 +0000 (23:46 +0000)]
ipv4: ARP neigh procfs buffer overflow

If arp_format_neigh_entry() can be called with n->dev->addr_len == 0, then a
write to hbuffer[-1] occurs.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c515: Write outside array bounds
roel kluin [Thu, 30 Jul 2009 00:26:32 +0000 (00:26 +0000)]
3c515: Write outside array bounds

if dev_alloc_skb() fails on the first iteration, a write to
cp->rx_ring[-1] occurs.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodocbook: fix printk of ip address
Tobias Klauser [Thu, 30 Jul 2009 20:10:50 +0000 (13:10 -0700)]
docbook: fix printk of ip address

Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoiscsi: Use GFP_ATOMIC in iscsi_offload_mesg().
Michael Chan [Wed, 29 Jul 2009 08:49:52 +0000 (08:49 +0000)]
iscsi: Use GFP_ATOMIC in iscsi_offload_mesg().

Changing to GFP_ATOMIC because the only caller in cnic/bnx2i may
be calling this function while holding spin_lock.

This problem was discovered by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/netlabel: Add kmalloc NULL tests
Julia Lawall [Thu, 30 Jul 2009 04:38:19 +0000 (04:38 +0000)]
net/netlabel: Add kmalloc NULL tests

The test on map4 should be a test on map6.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 30 Jul 2009 17:35:45 +0000 (10:35 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years ago[SCSI] sd: Avoid sending extended inquiry to legacy devices
Martin K. Petersen [Wed, 29 Jul 2009 18:06:53 +0000 (14:06 -0400)]
[SCSI] sd: Avoid sending extended inquiry to legacy devices

Some USB devices crash when we send them an inquiry with the EVPD bit
set, regardless of page requested (i.e. including page 0).

We only need the extended inquiry to gain access to VPD pages 0xB0 and
0xB1.  These appeared in SBC2 and SBC3 respectively, so we can restrict
sending the extended inquiry to devices reporting SPC3 or higher.

This fixes bugzilla.kernel.org #13657.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[jejb: added comment]
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>