11 years agoMerge branch 'linux-next' of git://
Linus Torvalds [Fri, 15 Apr 2011 14:44:22 +0000 (07:44 -0700)]
Merge branch 'linux-next' of git://

* 'linux-next' of git://
  UBIFS: fix compilation warnings when compiling with gcc 4.5
  UBIFS: fix oops when R/O file-system is fsync'ed

11 years agovfs: fix incorrect dentry_update_name_case() BUG_ON() test
Linus Torvalds [Fri, 15 Apr 2011 14:34:26 +0000 (07:34 -0700)]
vfs: fix incorrect dentry_update_name_case() BUG_ON() test

The case we should be verifying when updating the dentry name is that
the _parent_ inode (the directory) semaphore is held, not the semaphore
for the dentry itself.  It's the directory locking that rename and
readdir() etc all care about.

The comment just above even says so - but then the BUG_ON() still
checked the dentry inode itself.

Very few people noticed, because this helper function really isn't used
for very much, so you had to be using ncpfs to ever hit it.

I think I should just remove the BUG_ON (the function really has just
one user), but let's run with it fixed for a while before getting rid of
it entirely.

Reported-and-tested-by: Bongani Hlope <>
Reported-and-tested-by: Bernd Feige <>
Cc: Petr Vandrovec <>,
Cc: Arnd Bergmann <>
Cc: Christoph Hellwig <>
Cc: Nick Piggin <>
Signed-off-by: Linus Torvalds <>
11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 15 Apr 2011 02:03:27 +0000 (19:03 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/vapier/blackfin

* 'for-linus' of git://
  Blackfin: SMP: fix cache flush loop
  Blackfin: time-ts: ack gptimer sooner to avoid missing short ints
  Blackfin: gptimers: fix thinko when disabling timers
  Blackfin: SMP: make all barriers handle cache issues

11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 15 Apr 2011 02:02:55 +0000 (19:02 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://
  libceph: fix linger request requeueing

11 years agomm/thp: use conventional format for boolean attributes
Ben Hutchings [Thu, 14 Apr 2011 22:22:21 +0000 (15:22 -0700)]
mm/thp: use conventional format for boolean attributes

The conventional format for boolean attributes in sysfs is numeric ("0" or
"1" followed by new-line).  Any boolean attribute can then be read and
written using a generic function.  Using the strings "yes [no]", "[yes]
no" (read), "yes" and "no" (write) will frustrate this.

[ use kstrtoul()]
[ test_bit() doesn't return 1/0, per Neil]
Signed-off-by: Ben Hutchings <>
Cc: Andrea Arcangeli <>
Cc: Mel Gorman <>
Cc: Johannes Weiner <>
Cc: Rik van Riel <>
Cc: Hugh Dickins <>
Tested-by: David Rientjes <>
Cc: NeilBrown <>
Cc: <> [2.6.38.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoramfs: fix memleak on no-mmu arch
Bob Liu [Thu, 14 Apr 2011 22:22:20 +0000 (15:22 -0700)]
ramfs: fix memleak on no-mmu arch

On no-mmu arch, there is a memleak during shmem test.  The cause of this
memleak is ramfs_nommu_expand_for_mapping() added page refcount to 2
which makes iput() can't free that pages.

The simple test file is like this:

  int main(void)
int i;
key_t k = ftok("/etc", 42);

for ( i=0; i<100; ++i) {
int id = shmget(k, 10000, 0644|IPC_CREAT);
if (id == -1) {
printf("shmget error\n");
if(shmctl(id, IPC_RMID, NULL ) == -1) {
printf("shm  rm error\n");
return -1;
printf("run ok...\n");
return 0;

And the result:

  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        17912        42408            0            0
  -/+ buffers:              17912        42408
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        19096        41224            0            0
  -/+ buffers:              19096        41224
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        20296        40024            0            0
  -/+ buffers:              20296        40024

After this patch the test result is:(no memleak anymore)

  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        16668        43652            0            0
  -/+ buffers:              16668        43652
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        16668        43652            0            0
  -/+ buffers:              16668        43652

Signed-off-by: Bob Liu <>
Acked-by: Hugh Dickins <>
Signed-off-by: David Howells <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoum: disable CONFIG_CMPXCHG_LOCAL
Richard Weinberger [Thu, 14 Apr 2011 22:22:18 +0000 (15:22 -0700)]

Commit 8a5ec0ba "Lockless (and preemptless) fastpaths for slub" makes use
of this_cpu_cmpxchg_double() which needs this_cpu_cmpxchg16b_emu() on
x86_64.  Implementing cmpxchg16b emulation for UML would introduce too
much complexity.  So just disable it.

Signed-off-by: Richard Weinberger <>
Reported-by: Sergei Trofimovich <>
Acked-by: Pekka Enberg <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoum: fix call tracer and bug handler
Richard Weinberger [Thu, 14 Apr 2011 22:22:17 +0000 (15:22 -0700)]
um: fix call tracer and bug handler

Commit 1de1502c ("x86, um: now we can get rid of trivial uml headers")
removed accidentally bug.h which broke UML's call tracer and bug

Without asm-generic/bug.h UML uses BUG() from arch/x86/ which makes use
of ud2.  UML cannot use ud2, it raises SIGILL in user mode.  As UML has
a different stack for handling signals the call trace will be cut off.

Signed-off-by: Richard Weinberger <>
Reported-by: Sergei Trofimovich <>
Tested-by: Sergei Trofimovich <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agofs/fhandle.c: add <linux/personality.h> for ia64
Jeff Mahoney [Thu, 14 Apr 2011 22:22:16 +0000 (15:22 -0700)]
fs/fhandle.c: add <linux/personality.h> for ia64

force_o_largefile() on ia64 is defined in <asm/fcntl.h> and requires

Signed-off-by: Jeff Mahoney <>
Cc: Aneesh Kumar K.V <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoMAINTAINERS: change mail adress of Hans J. Koch
Hans J. Koch [Thu, 14 Apr 2011 22:22:16 +0000 (15:22 -0700)]
MAINTAINERS: change mail adress of Hans J. Koch

My old mail address doesn't exist anymore.  This patch changes all
occurences in MAINTAINERS to my new address.

Signed-off-by: Hans J. Koch <>
Cc: Joe Perches <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoRapidIO/mpc85xx: fix possible mport registration problems
Alexandre Bounine [Thu, 14 Apr 2011 22:22:14 +0000 (15:22 -0700)]
RapidIO/mpc85xx: fix possible mport registration problems

Fix a possible problem with mport registration left non-cleared after
fsl_rio_setup() exits on link error.  Abort mport initialization if
registration failed.

This patch is applicable to 2.6.39-rc1 only.  The problem does not exist
for earlier versions.

Signed-off-by: Alexandre Bounine <>
Cc: Kumar Gala <>
Cc: Matt Porter <>
Cc: Li Yang <>
Cc: Thomas Moll <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoRapidIO: add IDT CPS-1432 switch definitions
Alexandre Bounine [Thu, 14 Apr 2011 22:22:14 +0000 (15:22 -0700)]
RapidIO: add IDT CPS-1432 switch definitions

Signed-off-by: Alexandre Bounine <>
Cc: Matt Porter <>
Cc: Kumar Gala <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agooom-kill: remove boost_dying_task_prio()
KOSAKI Motohiro [Thu, 14 Apr 2011 22:22:13 +0000 (15:22 -0700)]
oom-kill: remove boost_dying_task_prio()

This is an almost-revert of commit 93b43fa ("oom: give the dying task a
higher priority").

That commit dramatically improved oom killer logic when a fork-bomb
occurs.  But I've found that it has nasty corner case.  Now cpu cgroup has
strange default RT runtime.  It's 0!  That said, if a process under cpu
cgroup promote RT scheduling class, the process never run at all.

If an admin inserts a !RT process into a cpu cgroup by setting
rtruntime=0, usually it runs perfectly because a !RT task isn't affected
by the rtruntime knob.  But if it promotes an RT task via an explicit
setscheduler() syscall or an OOM, the task can't run at all.  In short,
the oom killer doesn't work at all if admins are using cpu cgroup and don't
touch the rtruntime knob.

Eventually, kernel may hang up when oom kill occur.  I and the original
author Luis agreed to disable this logic.

Signed-off-by: KOSAKI Motohiro <>
Acked-by: Luis Claudio R. Goncalves <>
Acked-by: KAMEZAWA Hiroyuki <>
Reviewed-by: Minchan Kim <>
Acked-by: David Rientjes <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agovmscan: all_unreclaimable() use zone->all_unreclaimable as a name
KOSAKI Motohiro [Thu, 14 Apr 2011 22:22:12 +0000 (15:22 -0700)]
vmscan: all_unreclaimable() use zone->all_unreclaimable as a name

all_unreclaimable check in direct reclaim has been introduced at 2.6.19
by following commit.

2006 Sep 25; commit 408d8544; oom: use unreclaimable info

And it went through strange history. firstly, following commit broke
the logic unintentionally.

2008 Apr 29; commit a41f24ea; page allocator: smarter retry of
      costly-order allocations

Two years later, I've found obvious meaningless code fragment and
restored original intention by following commit.

2010 Jun 04; commit bb21c7ce; vmscan: fix do_try_to_free_pages()
      return value when priority==0

But, the logic didn't works when 32bit highmem system goes hibernation
and Minchan slightly changed the algorithm and fixed it .

2010 Sep 22: commit d1908362: vmscan: check all_unreclaimable
      in direct reclaim path

But, recently, Andrey Vagin found the new corner case. Look,

struct zone {
        int                     all_unreclaimable;
        unsigned long           pages_scanned;

zone->all_unreclaimable and zone->pages_scanned are neigher atomic
variables nor protected by lock.  Therefore zones can become a state of
zone->page_scanned=0 and zone->all_unreclaimable=1.  In this case, current
all_unreclaimable() return false even though zone->all_unreclaimabe=1.

This resulted in the kernel hanging up when executing a loop of the form

1. fork
2. mmap
3. touch memory
4. read memory
5. munmmap

as described in

Is this ignorable minor issue?  No.  Unfortunately, x86 has very small dma
zone and it become zone->all_unreclamble=1 easily.  and if it become
all_unreclaimable=1, it never restore all_unreclaimable=0.  Why?  if
all_unreclaimable=1, vmscan only try DEF_PRIORITY reclaim and
a-few-lru-pages>>DEF_PRIORITY always makes 0.  that mean no page scan at

Eventually, oom-killer never works on such systems.  That said, we can't
use zone->pages_scanned for this purpose.  This patch restore
all_unreclaimable() use zone->all_unreclaimable as old.  and in addition,
to add oom_killer_disabled check to avoid reintroduce the issue of commit
d1908362 ("vmscan: check all_unreclaimable in direct reclaim path").

Reported-by: Andrey Vagin <>
Signed-off-by: KOSAKI Motohiro <>
Cc: Nick Piggin <>
Reviewed-by: Minchan Kim <>
Reviewed-by: KAMEZAWA Hiroyuki <>
Acked-by: David Rientjes <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agomm: check that we have the right vma in __access_remote_vm()
Michael Ellerman [Thu, 14 Apr 2011 22:22:10 +0000 (15:22 -0700)]
mm: check that we have the right vma in __access_remote_vm()

In __access_remote_vm() we need to check that we have found the right
vma, not the following vma before we try to access it.  Otherwise we
might call the vma's access routine with an address which does not fall
inside the vma.

It was discovered on a current kernel but with an unreleased driver,
from memory it was strace leading to a kernel bad access, but it
obviously depends on what the access implementation does.

Looking at other access implementations I only see:

  $ git grep -A 5 vm_operations|grep access
  arch/powerpc/platforms/cell/spufs/file.c- .access = spufs_mem_mmap_access,
  arch/x86/pci/i386.c- .access = generic_access_phys,
  drivers/char/mem.c- .access = generic_access_phys
  fs/sysfs/bin.c- .access = bin_access,

The spufs one looks like it might behave badly given the wrong vma, it
assumes vma->vm_file->private_data is a spu_context, and looks like it
would probably blow up pretty quickly if it wasn't.

generic_access_phys() only uses the vma to check vm_flags and get the
mm, and then walks page tables using the address.  So it should bail on
the vm_flags check, or at worst let you access some other VM_IO mapping.

And bin_access() just proxies to another access implementation.

Signed-off-by: Michael Ellerman <>
Reviewed-by: KOSAKI Motohiro <>
Cc: Hugh Dickins <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agobrk: COMPAT_BRK: fix detection of randomized brk
Jiri Kosina [Thu, 14 Apr 2011 22:22:09 +0000 (15:22 -0700)]
brk: COMPAT_BRK: fix detection of randomized brk

5520e89 ("brk: fix min_brk lower bound computation for COMPAT_BRK")
tried to get the whole logic of brk randomization for legacy
(libc5-based) applications finally right.

It turns out that the way to detect whether brk has actually been
randomized in the end or not introduced by that patch still doesn't work
for those binaries, as reported by Geert:

: /sbin/init from my old m68k ramdisk exists prematurely.
: Before the patch:
: | brk(0x80005c8e)                         = 0x80006000
: After the patch:
: | brk(0x80005c8e)                         = 0x80005c8e
: Old libc5 considers brk() to have failed if the return value is not
: identical to the requested value.

I don't like it, but currently see no better option than a bit flag in
task_struct to catch the CONFIG_COMPAT_BRK && randomize_va_space == 2

Signed-off-by: Jiri Kosina <>
Tested-by: Geert Uytterhoeven <>
Reported-by: Geert Uytterhoeven <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agodrivers/misc/sgi-gru/grufile.c: fix the wrong members of gru_chip
Wanlong Gao [Thu, 14 Apr 2011 22:22:08 +0000 (15:22 -0700)]
drivers/misc/sgi-gru/grufile.c: fix the wrong members of gru_chip

Fix the wrong members and the wrong function's definition, since the
irq_chip had changed.

Signed-off-by: Wanlong Gao <>
Cc: Jack Steiner <>
Cc: Thomas Gleixner <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agotmpfs: fix off-by-one in max_blocks checks
Hugh Dickins [Thu, 14 Apr 2011 22:22:07 +0000 (15:22 -0700)]
tmpfs: fix off-by-one in max_blocks checks

If you fill up a tmpfs, df was showing

  tmpfs                   460800         -         -   -  /tmp

because of an off-by-one in the max_blocks checks.  Fix it so df shows

  tmpfs                   460800    460800         0 100% /tmp

Signed-off-by: Hugh Dickins <>
Cc: Tim Chen <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoMAINTAINERS: update STABLE BRANCH info
Randy Dunlap [Thu, 14 Apr 2011 22:22:07 +0000 (15:22 -0700)]

Drop Chris Wright from STABLE maintainers.  He hasn't done STABLE release
work for quite some time.

Signed-off-by: Randy Dunlap <>
Acked-by: Chris Wright <>
Cc: Greg KH <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agomm: add VM counters for transparent hugepages
Andi Kleen [Thu, 14 Apr 2011 22:22:06 +0000 (15:22 -0700)]
mm: add VM counters for transparent hugepages

I found it difficult to make sense of transparent huge pages without
having any counters for its actions.  Add some counters to vmstat for
allocation of transparent hugepages and fallback to smaller pages.

Optional patch, but useful for development and understanding the system.

Contains improvements from Andrea Arcangeli and Johannes Weiner

[ coding-style fixes]
[ fix vmstat_text[] entries]
Signed-off-by: Andi Kleen <>
Acked-by: Andrea Arcangeli <>
Reviewed-by: KAMEZAWA Hiroyuki <>
Signed-off-by: Johannes Weiner <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoMAINTAINERS: update various tty patterns
Joe Perches [Thu, 14 Apr 2011 22:22:05 +0000 (15:22 -0700)]
MAINTAINERS: update various tty patterns

Commits 4a6514e6d0 ("tty: move obsolete and broken tty drivers to
drivers/staging/tty/") and a6afd9f3e8 ("tty: move a number of tty drivers
from drivers/char/ to drivers/tty/") moved files around.

Update patterns and orphan some files that were moved to staging.

Signed-off-by: Joe Perches <>
Cc: Greg Kroah-Hartman <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoMAINTAINERS: update m68knommu patterns
Joe Perches [Thu, 14 Apr 2011 22:22:04 +0000 (15:22 -0700)]
MAINTAINERS: update m68knommu patterns

Commit 66d857b08b ("m68k: merge m68k and m68knommu arch directories")
moved the files around.

Signed-off-by: Joe Perches <>
Acked-by: Greg Ungerer <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoMAINTAINERS: add ARM/ts78xx-setup platform maintainer
Alexander Clouter [Thu, 14 Apr 2011 22:22:02 +0000 (15:22 -0700)]
MAINTAINERS: add ARM/ts78xx-setup platform maintainer

Signed-off-by: Alexander Clouter <>
Cc: Russell King <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agokstrtox: simpler code in _kstrtoull()
Alexey Dobriyan [Thu, 14 Apr 2011 22:22:02 +0000 (15:22 -0700)]
kstrtox: simpler code in _kstrtoull()

Signed-off-by: Alexey Dobriyan <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agokstrtox: fix compile warnings in test
Alexey Dobriyan [Thu, 14 Apr 2011 22:22:00 +0000 (15:22 -0700)]
kstrtox: fix compile warnings in test

Fix the following warnings:

    CC [M]  lib/test-kstrtox.o
  lib/test-kstrtox.c: In function 'test_kstrtou64_ok':
  lib/test-kstrtox.c:318: warning: this decimal constant is unsigned only in ISO C90

Signed-off-by: Alexey Dobriyan <>
Reported-by: Geert Uytterhoeven <>
Acked-by: Geert Uytterhoeven <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoleds/leds-regulator.c: fix handling of already enabled regulators
Antonio Ospite [Thu, 14 Apr 2011 22:21:59 +0000 (15:21 -0700)]
leds/leds-regulator.c: fix handling of already enabled regulators

Make the driver aware of the initial status of the regulator.

The leds-regulator driver was ignoring the initial status of the
regulator; this resulted in rdev->use_count being incremented to 2 after
calling regulator_led_set_value() in the .probe method when a regulator
was already enabled at insmod time, which made it impossible to ever
disable the regulator.

Signed-off-by: Antonio Ospite <>
Cc: Richard Purdie <>
Cc: Antonio Ospite <>
Acked-by: Mark Brown <>
Cc: Liam Girdwood <>
Cc: Daniel Ribeiro <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agovmstat: update comment regarding stat_threshold
Christoph Lameter [Thu, 14 Apr 2011 22:21:58 +0000 (15:21 -0700)]
vmstat: update comment regarding stat_threshold

Signed-off-by: Christoph Lameter <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agomm/page_alloc.c: silence build_all_zonelists() section mismatch
Paul Mundt [Thu, 14 Apr 2011 22:21:57 +0000 (15:21 -0700)]
mm/page_alloc.c: silence build_all_zonelists() section mismatch

The memory hotplug case involves calling to build_all_zonelists() which
in turns calls in to setup_zone_pageset().  The latter is marked
__meminit while build_all_zonelists() itself has no particular
annotation.  build_all_zonelists() is only handed a non-NULL pointer in
the case of memory hotplug through an existing __meminit path, so the
setup_zone_pageset() reference is always safe.

The options as such are either to flag build_all_zonelists() as __ref (as
per __build_all_zonelists()), or to simply discard the __meminit
annotation from setup_zone_pageset().

Signed-off-by: Paul Mundt <>
Acked-by: Mel Gorman <>
Cc: KAMEZAWA Hiroyuki <>
Acked-by: Randy Dunlap <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agofs/partitions/ldm.c: fix oops caused by corrupted partition table
Timo Warns [Thu, 14 Apr 2011 22:21:56 +0000 (15:21 -0700)]
fs/partitions/ldm.c: fix oops caused by corrupted partition table

The kernel automatically evaluates partition tables of storage devices.
The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
a bug that causes a kernel oops on certain corrupted LDM partitions.
A kernel subsystem seems to crash, because, after the oops, the kernel no
longer recognizes newly connected storage devices.

The patch validates the value of vblk_size.

[ coding-style fixes]
Signed-off-by: Timo Warns <>
Cc: Eugene Teo <>
Cc: Harvey Harrison <>
Cc: Richard Russon <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agodrivers/rtc/rtc-mc13xxx.c: fix unterminated platform_device_id table
Axel Lin [Thu, 14 Apr 2011 22:21:55 +0000 (15:21 -0700)]
drivers/rtc/rtc-mc13xxx.c: fix unterminated platform_device_id table

The platform_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <>
Acked-by: Uwe Kleine-König <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agomm: optimize pfn calculation in online_page()
Daniel Kiper [Thu, 14 Apr 2011 22:21:53 +0000 (15:21 -0700)]
mm: optimize pfn calculation in online_page()

If CONFIG_FLATMEM is enabled pfn is calculated in online_page() more than
once.  It is possible to optimize that and use value established at
beginning of that function.

Signed-off-by: Daniel Kiper <>
Acked-by: Dave Hansen <>
Cc: KAMEZAWA Hiroyuki <>
Cc: Wu Fengguang <>
Cc: Mel Gorman <>
Cc: Christoph Lameter <>
Acked-by: David Rientjes <>
Reviewed-by: Jesper Juhl <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agomemcg: fix mem_cgroup_rotate_reclaimable_page()
Eric Dumazet [Thu, 14 Apr 2011 22:21:52 +0000 (15:21 -0700)]
memcg: fix mem_cgroup_rotate_reclaimable_page()

commit 3f58a8294333 ("move memcg reclaimable page into tail of inactive
list") added inline keyword twice in its prototype.

    CC      arch/x86/kernel/asm-offsets.s
  In file included from include/linux/swap.h:8,
                   from include/linux/suspend.h:4,
                   from arch/x86/kernel/asm-offsets.c:12:
  include/linux/memcontrol.h:220: error: duplicate `inline'

Signed-off-by: Eric Dumazet <>
Reviewed-by: Minchan Kim <>
Cc: Balbir Singh <>
Cc: KAMEZAWA Hiroyuki <>
Cc: KOSAKI Motohiro <>
Cc: Johannes Weiner <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
11 years agoBlackfin: SMP: fix cache flush loop
Sonic Zhang [Tue, 12 Apr 2011 08:16:04 +0000 (08:16 +0000)]
Blackfin: SMP: fix cache flush loop

The recent commit (10774912647781) wasn't entirely correct.  While
it fixed some issues, it introduced others.  So pull in the fixes
from the public cache flush functions, and document why we need to
call things directly ourselves.

Signed-off-by: Sonic Zhang <>
Signed-off-by: Mike Frysinger <>
11 years agoBlackfin: time-ts: ack gptimer sooner to avoid missing short ints
Mike Frysinger [Mon, 4 Apr 2011 15:26:11 +0000 (15:26 +0000)]
Blackfin: time-ts: ack gptimer sooner to avoid missing short ints

If the period of a gptimer is fairly low, we might miss an interrupt
by acking it too late (we end up acking the new int as well).

Reported-by: Isabelle Leonardi <>
Signed-off-by: Mike Frysinger <>
11 years agoBlackfin: gptimers: fix thinko when disabling timers
Mike Frysinger [Mon, 4 Apr 2011 15:20:50 +0000 (15:20 +0000)]
Blackfin: gptimers: fix thinko when disabling timers

We only want to clear the run bit for this one timer, not all status bits.
So don't read the whole reg and then write all the bits back out.

Reported-by: Isabelle Leonardi <>
Signed-off-by: Mike Frysinger <>
11 years agoBlackfin: SMP: make all barriers handle cache issues
Graf Yang [Thu, 7 Jan 2010 06:57:30 +0000 (06:57 +0000)]
Blackfin: SMP: make all barriers handle cache issues

When suspending/resuming, the common task freezing code will run in
parallel and freeze processes on each core.  This is because the code
uses the non-smp version of memory barriers (as well it should).

The Blackfin smp barrier logic at the moment contains the cache sync
logic, but the non-smp barriers do not.  This is incorrect as Rafel
> ...
> The existing memory barriers are SMP barriers too, but they are more
> than _just_ SMP barriers.  At least that's how it is _supposed_ to be
> (eg. rmb() is supposed to be stronger than smp_rmb()).
> ...
> However, looking at the blackfin's definitions of SMP barriers I see
> that it uses extra stuff that should _also_ be used in the definitions
> of the mandatory barriers.
> ...

LKML-Reference: <>
Signed-off-by: Graf Yang <>
Signed-off-by: Mike Frysinger <>
11 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Wed, 13 Apr 2011 16:15:55 +0000 (09:15 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://
  x86 platform drivers: Build fix for intel_pmic_gpio

11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Wed, 13 Apr 2011 16:15:40 +0000 (09:15 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/egtvedt/avr32-2.6

* 'for-linus' of git://
  avr32: add ATAG_BOARDINFO
  don't check platform_get_irq's return value against zero
  avr32: init cannot ignore signals sent by force_sig_info()
  avr32: fix deadlock when reading clock list in debugfs
  avr32: Fix .size directive for cpu_enter_idle
  avr32: At32ap: pio fix typo "))" on gpio_irq_unmask prototype
  fix the wrong argument of the functions definition

11 years agoMerge branch 'drm-fixes' of git://
Linus Torvalds [Wed, 13 Apr 2011 16:10:25 +0000 (09:10 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git:// (22 commits)
  Revert "i915: restore only the mode of this driver on lastclose"
  Revert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."
  drm/radeon/kms: properly program vddci on evergreen+
  drm/radeon/kms: add voltage type to atom set voltage function
  drm/radeon/kms: fix pcie_p callbacks on btc and cayman
  drm/radeon/kms: fix suspend on rv530 asics
  drm/radeon/kms: clean up gart dummy page handling
  drm/radeon/kms: make radeon i2c put/get bytes less noisy
  drm/radeon/kms: pll tweaks for rv6xx
  drm/radeon: Fix KMS legacy backlight support if CONFIG_BACKLIGHT_CLASS_DEVICE=m.
  radeon: Fix KMS CP writeback on big endian machines.
  i915: restore only the mode of this driver on lastclose
  drm/nvc0: improve vm flush function
  drm/nv50-nvc0: remove some code that doesn't belong here
  drm/nv50: use "nv86" tlb flush method on everything except 0x50/0xac
  drm/nouveau: quirk for XFX GT-240X-YA
  drm/nv50-nvc0: work around an evo channel hang that some people see
  drm/nouveau: implement init table opcode 0x5c
  drm/nouveau: fix oops on unload with disabled LVDS panel

11 years agox86 platform drivers: Build fix for intel_pmic_gpio
Matthew Garrett [Wed, 13 Apr 2011 15:52:16 +0000 (11:52 -0400)]
x86 platform drivers: Build fix for intel_pmic_gpio

Fix an incorrect function name so the driver builds.

Signed-off-by: Matthew Garrett <>
11 years agoblock: don't flush plugged IO on forced preemtion scheduling
Linus Torvalds [Wed, 13 Apr 2011 15:08:20 +0000 (08:08 -0700)]
block: don't flush plugged IO on forced preemtion scheduling

We really only want to unplug the pending IO when the process actually
goes to sleep.  So move the test for flushing the plug up to the place
where we actually deactivate the task - where we have properly checked
for preemption and for the process really sleeping.

Acked-by: Jens Axboe <>
Acked-by: Peter Zijlstra <>
Signed-off-by: Linus Torvalds <>
11 years agovm: fix vm_pgoff wrap in stack expansion
Linus Torvalds [Wed, 13 Apr 2011 15:07:28 +0000 (08:07 -0700)]
vm: fix vm_pgoff wrap in stack expansion

Commit 982134ba6261 ("mm: avoid wrapping vm_pgoff in mremap()") fixed
the case of a expanding mapping causing vm_pgoff wrapping when you used
mremap.  But there was another case where we expand mappings hiding in
plain sight: the automatic stack expansion.

This fixes that case too.

This one also found by Robert Święcki, using his nasty system call
fuzzer tool.  Good job.

Reported-and-tested-by: Robert Święcki <>
Signed-off-by: Linus Torvalds <>
11 years agoavr32: add ATAG_BOARDINFO
Andreas Bießmann [Wed, 13 Apr 2011 08:07:35 +0000 (10:07 +0200)]

The ATAG_BOARDINFO is intended to hand over the information
bd->bi_board_number from u-boot to the kernel.

This piece of information can be used to implement some kind of board
identification while booting the kernel. Therefore it is placed in .initdata
section and can be accessed via the new symbol board_number only while
initializing the kernel.

Signed-off-by: Andreas Bießmann <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agodon't check platform_get_irq's return value against zero
Uwe Kleine-König [Wed, 9 Feb 2011 10:28:04 +0000 (11:28 +0100)]
don't check platform_get_irq's return value against zero

platform_get_irq returns -ENXIO on failure, so !int_irq was probably
always true.  Better use (int)int_irq <= 0.  Note that a return value of
zero is still handled as error even though this could mean irq0.

This is a followup to 305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0 that
changed the return value of platform_get_irq from 0 to -ENXIO on error.

Acked-by: Hans-Christian Egtvedt <>
Signed-off-by: Uwe Kleine-König <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agoavr32: init cannot ignore signals sent by force_sig_info()
Matt Fleming [Mon, 4 Apr 2011 14:58:04 +0000 (15:58 +0100)]
avr32: init cannot ignore signals sent by force_sig_info()

We can delete the code that checks to see if we're sending an ignored
signal to init because force_sig_info() already handles this case.
force_sig_info() will kill init even if the signal handler is SIG_DFL
and the scenario described in the comment where init might "generate
the same exception over and over again" cannot occur (force_sig_info()
clears SIGNAL_UNKILLABLE to ensure that init will die).

Also, the use of is_global_init() is not correct in the multhreaded
case, as Oleg Nesterov explains,

"is_global_init() is not right in theory, /sbin/init can be
multithreaded. And, this doesn't cover the sub-namespace
inits... I'd suggest to check SIGNAL_UNKILLABLE, but looking
closer I think you can simply remove this code."

It seems this code was copied from arch/powerpc in March 2007 in commit

  623b0355d5b1 "[AVR32] Clean up exception handling code"

but the code was deleted from arch/powerpc in November 2009 in commit

  a0592d42fe3e "powerpc: kill the obsolete code under is_global_init()"

So catch up with powerpc and delete the bogus code.

Signed-off-by: Matt Fleming <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agoavr32: fix deadlock when reading clock list in debugfs
Ole Henrik Jahren [Sun, 6 Mar 2011 19:42:39 +0000 (20:42 +0100)]
avr32: fix deadlock when reading clock list in debugfs

When writing out /sys/kernel/debug/at32ap_clk, clock list lock is being
held while clk_get() is called. clk_get() attempts to take the same
lock, which results in deadlock. Introduce and call lock free version,
__clk_get(), instead.

Signed-off-by: Ole Henrik Jahren <>
Cc: Hans-Christian Egtvedt <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agoavr32: Fix .size directive for cpu_enter_idle
Ben Hutchings [Wed, 9 Mar 2011 00:32:36 +0000 (00:32 +0000)]
avr32: Fix .size directive for cpu_enter_idle

gas used to accept (and ignore?) .size directives which referred to
undefined symbols, as this does.  In binutils 2.21 these are treated
as errors.

Signed-off-by: Ben Hutchings <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agoavr32: At32ap: pio fix typo "))" on gpio_irq_unmask prototype
Jean-Christophe PLAGNIOL-VILLARD [Sun, 10 Apr 2011 04:17:20 +0000 (06:17 +0200)]
avr32: At32ap: pio fix typo "))" on gpio_irq_unmask prototype

introduce in commit d75f1bfdbccb

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <>
Cc: Thomas Gleixner <>
Cc: Hans-Christian Egtvedt <>
Cc: Nicolas Ferre <>
Cc: Patrice Vilchez <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agofix the wrong argument of the functions definition
Wanlong Gao [Sun, 10 Apr 2011 06:14:43 +0000 (14:14 +0800)]
fix the wrong argument of the functions definition

The functions of eic_chip's memebers use the wrong argument .

Signed-off-by: Wanlong Gao <>
Signed-off-by: Hans-Christian Egtvedt <>
11 years agoUBIFS: fix compilation warnings when compiling with gcc 4.5
Maksim Rayskiy [Tue, 12 Apr 2011 22:14:56 +0000 (15:14 -0700)]
UBIFS: fix compilation warnings when compiling with gcc 4.5

When compiling UBIFS with CONFIG_UBIFS_FS_DEBUG not set,
gcc-4.5.2 generates a slew of "warning: statement with no effect"
on references to non-void functions defined as 0.
To avoid these warnings, replace #defines with dummy inline functions.

Artem: massage the patch a bit, also remove the duplicate
       'dbg_check_lprops()' prototype.

Signed-off-by: Maksim Rayskiy <>
Acked-by: Mike Frysinger <>
Signed-off-by: Artem Bityutskiy <>
11 years agoUBIFS: fix oops when R/O file-system is fsync'ed
Artem Bityutskiy [Wed, 13 Apr 2011 07:31:52 +0000 (10:31 +0300)]
UBIFS: fix oops when R/O file-system is fsync'ed

This patch fixes severe UBIFS bug: UBIFS oopses when we 'fsync()' an
file on R/O-mounter file-system. We (the UBIFS authors) incorrectly
thought that VFS would not propagate 'fsync()' down to the file-system
if it is read-only, but this is not the case.

It is easy to exploit this bug using the following simple perl script:

use strict;
use File::Sync qw(fsync sync);

die "File path is not specified" if not defined $ARGV[0];
my $path = $ARGV[0];

open FILE, "<", "$path" or die "Cannot open $path: $!";
fsync(\*FILE) or die "cannot fsync $path: $!";
close FILE or die "Cannot close $path: $!";

Thanks to Reuben Dowle <> for reporting about this

Signed-off-by: Artem Bityutskiy <>
Reported-by: Reuben Dowle <>
11 years agom68k,m68knommu: Wire up name_to_handle_at, open_by_handle_at, clock_adjtime, syncfs
Geert Uytterhoeven [Tue, 12 Apr 2011 20:24:45 +0000 (22:24 +0200)]
m68k,m68knommu: Wire up name_to_handle_at, open_by_handle_at, clock_adjtime, syncfs

Signed-off-by: Geert Uytterhoeven <>
Acked-by: Greg Ungerer <>
Signed-off-by: Linus Torvalds <>
11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Wed, 13 Apr 2011 00:18:05 +0000 (17:18 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/rafael/suspend-2.6

* 'for-linus' of git://
  fix XEN_SAVE_RESTORE Kconfig dependencies

11 years agoRevert "i915: restore only the mode of this driver on lastclose"
Dave Airlie [Tue, 12 Apr 2011 23:20:24 +0000 (09:20 +1000)]
Revert "i915: restore only the mode of this driver on lastclose"

This reverts commit 0a0883c8433c743dad0a4d9ebe2717558f2c209e.

this was in my tree by accident, I meant to rebase it out and
didn't realise in time.

Signed-off-by: Dave Airlie <>
11 years agoRevert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."
Dave Airlie [Tue, 12 Apr 2011 23:15:09 +0000 (09:15 +1000)]
Revert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."

This reverts commit 69a07f0b117a40fcc1a479358d8e1f41793617f2.

We've tracked a number of problems back to this, and Thomas
thinks we should redesign this for .40/41 anyways so I'm
happy to revert it.

Signed-off-by: Dave Airlie <>
11 years agoi915: select VIDEO_OUTPUT_CONTROL for ACPI_VIDEO
Konstantin Khlebnikov [Tue, 12 Apr 2011 10:27:47 +0000 (14:27 +0400)]

fix Kconfig warning:

(DRM_I915 && STUB_POULSBO) selects ACPI_VIDEO which has unmet direct dependencies

Signed-off-by: Konstantin Khlebnikov <>
Signed-off-by: Dave Airlie <>
11 years agodrm/radeon/kms: properly program vddci on evergreen+
Alex Deucher [Tue, 12 Apr 2011 18:49:24 +0000 (14:49 -0400)]
drm/radeon/kms: properly program vddci on evergreen+

Change vddci as well as vddc when changing power modes
on evergreen/ni.  Also, properly set vddci on boot up
for ni cards.  The vbios only sets the limited clocks
and voltages on boot until the mc ucode is loaded.  This
should fix stability problems on some btc cards.

Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
11 years agodrm/radeon/kms: add voltage type to atom set voltage function
Alex Deucher [Tue, 12 Apr 2011 18:49:23 +0000 (14:49 -0400)]
drm/radeon/kms: add voltage type to atom set voltage function

This is needed for setting voltages other than vddc.

Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
11 years agodrm/radeon/kms: fix pcie_p callbacks on btc and cayman
Alex Deucher [Tue, 12 Apr 2011 17:40:18 +0000 (13:40 -0400)]
drm/radeon/kms: fix pcie_p callbacks on btc and cayman

btc and cayman asics use the same callback for
pcie port registers.

Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
11 years agodrm/radeon/kms: fix suspend on rv530 asics
Alex Deucher [Tue, 12 Apr 2011 17:33:27 +0000 (13:33 -0400)]
drm/radeon/kms: fix suspend on rv530 asics

Apparently only rv515 asics need the workaround
added in f24d86f1a49505cdea56728b853a5d0a3f8e3d11
(drm/radeon/kms: fix resume regression for some r5xx laptops).


Signed-off-by: Alex Deucher <>
Signed-off-by: Dave Airlie <>
11 years agodrm/radeon/kms: clean up gart dummy page handling
Alex Deucher [Tue, 12 Apr 2011 17:32:13 +0000 (13:32 -0400)]
drm/radeon/kms: clean up gart dummy page handling

As per Konrad's original patch, the dummy page used
by the gart code and allocated in radeon_gart_init()
was not freed properly in radeon_gart_fini().

At the same time r6xx and newer allocated and freed the
dummy page on their own.  So to do Konrad's patch one
better, just remove the allocation and freeing of the
dummy page in the r6xx, 7xx, evergreen, and ni code and
allocate and free in the gart_init/fini() functions for
all asics.

Cc: Jerome Glisse <>
Signed-off-by: Alex Deucher <>
Acked-by: Konrad Rzeszutek Wilk <>
Signed-off-by: Dave Airlie <>
11 years agoMerge git://
Linus Torvalds [Tue, 12 Apr 2011 22:24:42 +0000 (15:24 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://
  cifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3)
  [CIFS] Warn on requesting default security (ntlm) on mount
  [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood
  cifs: wrap received signature check in srv_mutex
  cifs: clean up various nits in unicode routines (try #2)
  cifs: clean up length checks in check2ndT2
  cifs: set ra_pages in backing_dev_info
  cifs: fix broken BCC check in is_valid_oplock_break
  cifs: always do is_path_accessible check in cifs_mount
  various endian fixes to cifs
  Elminate sparse __CHECK_ENDIAN__ warnings on port conversion
  Max share size is too small
  Allow user names longer than 32 bytes
  cifs: replace /proc/fs/cifs/Experimental with a module parm
  cifs: check for private_data before trying to put it

11 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Tue, 12 Apr 2011 22:24:23 +0000 (15:24 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://
  thinkpad-acpi fails to load with newer Thinkpad X201s BIOS
  acer-wmi: Fix capitalisation of GUID in module alias
  sony-laptop: keyboard backlight fixes
  sony-laptop: only show the handles sysfs file in debug mode
  samsung-laptop: set backlight type
  staging: samsung-laptop has moved to platform/x86
  samsung-laptop: Samsung R410P backlight driver
  samsung-laptop: add support for N230 model
  platform-drivers: x86: pmic: Restore the dropped buslock/unlock
  sony-laptop: fix early NULL pointer dereference
  msi-laptop: fix config-dependent build error
  eeepc-wmi: add keys found on EeePC 1215T
  asus-wmi: swap input name and phys
  asus-laptop: remove removed features from feature-removal-schedule.txt

11 years agovfs: Re-introduce s_uuid in the superblock
Linus Torvalds [Tue, 12 Apr 2011 22:21:04 +0000 (15:21 -0700)]
vfs: Re-introduce s_uuid in the superblock

Gaah.  When commit be85bccaa5aa reverted the export of file system uuid
via /proc/<pid>/mountinfo, it also unintentionally removed the s_uuid
field in struct super_block.

I didn't mean to do that, since filesystems have been taught to fill it
in (and we want to keep it for future re-introduction in the mountinfo

Stupid of me. This adds it back in.

Signed-off-by: Linus Torvalds <>
11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 12 Apr 2011 21:25:10 +0000 (14:25 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://
  mfd: Fetch cell pointer from platform_device->mfd_cell

11 years agonfs: don't call __mark_inode_dirty while holding i_lock
Dave Chinner [Tue, 12 Apr 2011 09:18:08 +0000 (19:18 +1000)]
nfs: don't call __mark_inode_dirty while holding i_lock

nfs_scan_commit() is called with the inode->i_lock held, but it then
calls __mark_inode_dirty() while still holding the lock. This causes
a deadlock.

Push the inode->i_lock into nfs_scan_commit() so it can protect only
the parts of the code it needs to and can be dropped before the call
to __mark_inode_dirty() to avoid the deadlock.

Signed-off-by: Dave Chinner <>
Tested-by: Will Simoneau <>
Signed-off-by: Linus Torvalds <>
11 years agovm: fix mlock() on stack guard page
Linus Torvalds [Tue, 12 Apr 2011 21:15:51 +0000 (14:15 -0700)]
vm: fix mlock() on stack guard page

Commit 53a7706d5ed8 ("mlock: do not hold mmap_sem for extended periods
of time") changed mlock() to care about the exact number of pages that
__get_user_pages() had brought it.  Before, it would only care about

And that doesn't work, because we also handled one page specially in
__mlock_vma_pages_range(), namely the stack guard page.  So when that
case was handled, the number of pages that the function returned was off
by one.  In particular, it could be zero, and then the caller would end
up not making any progress at all.

Rather than try to fix up that off-by-one error for the mlock case
specially, this just moves the logic to handle the stack guard page
into__get_user_pages() itself, thus making all the counts come out
right automatically.

Reported-by: Robert Święcki <>
Cc: Hugh Dickins <>
Cc: Oleg Nesterov <>
Signed-off-by: Linus Torvalds <>
11 years agoRevert "vfs: Export file system uuid via /proc/<pid>/mountinfo"
Linus Torvalds [Tue, 12 Apr 2011 20:35:56 +0000 (13:35 -0700)]
Revert "vfs: Export file system uuid via /proc/<pid>/mountinfo"

This reverts commit 93f1c20bc8cdb757be50566eff88d65c3b26881f.

It turns out that libmount misparses it because it adds a '-' character
in the uuid string, which libmount then incorrectly confuses with the
separator string (" - ") at the end of all the optional arguments.

Upstream libmount (in the util-linux tree) has been fixed, but until
that fix actually percolates up to users, we'd better not expose this
change in the kernel.

Let's revisit this later (possibly by exposing the UUID without any '-'
characters in it, avoiding the user-space bug).

Reported-by: Dave Jones <>
Cc: Aneesh Kumar K.V <>
Cc: Al Viro <>
Cc: Karel Zak <>
Cc: Ram Pai <>
Cc: Miklos Szeredi <>
Cc: Eric Sandeen <>
Signed-off-by: Linus Torvalds <>
11 years agothinkpad-acpi fails to load with newer Thinkpad X201s BIOS
Keith Packard [Thu, 31 Mar 2011 22:22:33 +0000 (15:22 -0700)]
thinkpad-acpi fails to load with newer Thinkpad X201s BIOS

The new BIOS has a slightly different EC version string.

From a1541710300b083a1a9acff2890d721d15ede62b Mon Sep 17 00:00:00 2001
From: Keith Packard <>
Date: Sun, 13 Mar 2011 23:46:22 -0700
Subject: [PATCH] thinkpad-acpi: Some BIOS versions don't end in WW, remove check

My X201s BIOS version string is 6QET46V1 (1.16 ). The
EC version string is 6QHT28WW-1.09. The driver was requiring that both
of these have 'WW' in positions 6 and 7. I don't know what the
significance of having 'V1' there instead is, but removing the test
makes the driver load on my machine.

Signed-off-by: Keith Packard <>
Signed-off-by: Matthew Garrett <>
11 years agoacer-wmi: Fix capitalisation of GUID in module alias
Lee, Chun-Yi [Wed, 6 Apr 2011 09:40:06 +0000 (17:40 +0800)]
acer-wmi: Fix capitalisation of GUID in module alias

wmi:6AF4F258-B401-42Fd-BE91-3D4AC2D7C0D3 needs to be
wmi:6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3 in module alias for acer-wmi is
automatically loaded.

Cc: Pali Rohár <>
Cc: Carlos Corbacho <>
Cc: Matthew Garrett <>
Signed-off-by: Lee, Chun-Yi <>
Signed-off-by: Matthew Garrett <>
11 years agosony-laptop: keyboard backlight fixes
Marco Chiappero [Tue, 5 Apr 2011 14:38:34 +0000 (23:38 +0900)]
sony-laptop: keyboard backlight fixes

Restore the original state on module removal, set the latest values on
When setting the keyboard backlight mode try to turn on/off backlight

[ patch taken from a largely modified sony-laptop.c,
ported and slightly modified to use defines already available.]

Signed-off-by: Mattia Dongili <>
Signed-off-by: Matthew Garrett <>
11 years agosony-laptop: only show the handles sysfs file in debug mode
Mattia Dongili [Tue, 5 Apr 2011 14:38:35 +0000 (23:38 +0900)]
sony-laptop: only show the handles sysfs file in debug mode

It makes no sense to expose this type of information to userspace unless
the driver was explicitly loaded with the debug option.

Signed-off-by: Mattia Dongili <>
Signed-off-by: Matthew Garrett <>
11 years agosamsung-laptop: set backlight type
Michal Marek [Fri, 8 Apr 2011 15:02:05 +0000 (17:02 +0200)]
samsung-laptop: set backlight type

Cherry-picked from drivers/staging/samsung-laptop/samsung-laptop.c

Signed-off-by: Michal Marek <>
Signed-off-by: Matthew Garrett <>
11 years agostaging: samsung-laptop has moved to platform/x86
Michal Marek [Fri, 8 Apr 2011 15:02:06 +0000 (17:02 +0200)]
staging: samsung-laptop has moved to platform/x86

Signed-off-by: Michal Marek <>
Signed-off-by: Matthew Garrett <>
11 years agosamsung-laptop: Samsung R410P backlight driver
Alberto Mardegan [Fri, 8 Apr 2011 15:02:03 +0000 (17:02 +0200)]
samsung-laptop: Samsung R410P backlight driver

Here's a trivial patch which adds support to the backlight device found
in Samsung R410 Plus laptops.

Signed-off-by: Alberto Mardegan <>
Signed-off-by: Greg Kroah-Hartman <>
[mmarek: cherry-picked from staging commit d542f180]
Signed-off-by: Michal Marek <>
Signed-off-by: Matthew Garrett <>
11 years agosamsung-laptop: add support for N230 model
Greg Kroah-Hartman [Fri, 8 Apr 2011 15:02:04 +0000 (17:02 +0200)]
samsung-laptop: add support for N230 model

Signed-off-by: Greg Kroah-Hartman <>
[mmarek: cherry-picked from staging commit 0789b003]
Signed-off-by: Michal Marek <>
Signed-off-by: Matthew Garrett <>
11 years agocifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3)
Jeff Layton [Tue, 12 Apr 2011 13:13:44 +0000 (09:13 -0400)]
cifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3)

This is more or less the same patch as before, but with some merge
conflicts fixed up.

If a process has a dirty page mapped into its page tables, then it has
the ability to change it while the client is trying to write the data
out to the server. If that happens after the signature has been
calculated then that signature will then be wrong, and the server will
likely reset the TCP connection.

This patch adds a page_mkwrite handler for CIFS that simply takes the
page lock. Because the page lock is held over the life of writepage and
writepages, this prevents the page from becoming writeable until
the write call has completed.

With this, we can also remove the "sign_zero_copy" module option and
always inline the pages when writing.

Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agomfd: Fetch cell pointer from platform_device->mfd_cell
Samuel Ortiz [Thu, 7 Apr 2011 22:43:01 +0000 (00:43 +0200)]
mfd: Fetch cell pointer from platform_device->mfd_cell

In order for MFD drivers to fetch their cell pointer but also their
platform data one, an mfd cell pointer is added to the platform_device
That allows all MFD sub devices drivers to be MFD agnostic, unless
they really need to access their MFD cell data. Most of them don't,
especially the ones for IPs used by both MFD and non MFD SoCs.

Cc: Grant Likely <>
Acked-by: Greg KH <>
Signed-off-by: Samuel Ortiz <>
11 years agoMerge branch 'stable/bug-fixes-rc2' of git://
Linus Torvalds [Tue, 12 Apr 2011 03:01:04 +0000 (20:01 -0700)]
Merge branch 'stable/bug-fixes-rc2' of git://git./linux/kernel/git/konrad/xen

* 'stable/bug-fixes-rc2' of git://
  xen: Allow PV-OPS kernel to detect whether XSAVE is supported
  xen: just completely disable XSAVE
  xen/debug: Don't be so verbose with WARN on 1-1 mapping errors.
  xen: events: fix error checks in bind_*_to_irqhandler()

11 years ago[CIFS] Warn on requesting default security (ntlm) on mount
Steve French [Tue, 12 Apr 2011 01:24:57 +0000 (01:24 +0000)]
[CIFS] Warn on requesting default security (ntlm) on mount

Warn once if default security (ntlm) requested. We will
update the default to the stronger security mechanism
(ntlmv2) in 2.6.41.  Kerberos is also stronger than
ntlm, but more servers support ntlmv2 and ntlmv2
does not require an upcall, so ntlmv2 is a better

Reviewed-by: Jeff Layton <>
CC: Suresh Jayaraman <>
Reviewed-by: Shirish Pargaonkar <>
Signed-off-by: Steve French <>
11 years ago[CIFS] cifs: clarify the meaning of tcpStatus == CifsGood
Steve French [Tue, 12 Apr 2011 01:01:14 +0000 (01:01 +0000)]
[CIFS] cifs: clarify the meaning of tcpStatus == CifsGood

When the TCP_Server_Info is first allocated and connected, tcpStatus ==
CifsGood means that the NEGOTIATE_PROTOCOL request has completed and the
socket is ready for other calls. cifs_reconnect however sets tcpStatus
to CifsGood as soon as the socket is reconnected and the optional
RFC1001 session setup is done. We have no clear way to tell the
difference between these two states, and we need to know this in order
to know whether we can send an echo or not.

Resolve this by adding a new statusEnum value -- CifsNeedNegotiate. When
the socket has been connected but has not yet had a NEGOTIATE_PROTOCOL
request done, set it to this value. Once the NEGOTIATE is done,
cifs_negotiate_protocol will set tcpStatus to CifsGood.

This also fixes and cleans the logic in cifs_reconnect and
cifs_reconnect_tcon. The old code checked for specific states when what
it really wants to know is whether the state has actually changed from

Reported-and-Tested-by: JG <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: wrap received signature check in srv_mutex
Jeff Layton [Sat, 2 Apr 2011 11:34:30 +0000 (07:34 -0400)]
cifs: wrap received signature check in srv_mutex

While testing my patchset to fix asynchronous writes, I hit a bunch
of signature problems when testing with signing on. The problem seems
to be that signature checks on receive can be running at the same
time as a process that is sending, or even that multiple receives can
be checking signatures at the same time, clobbering the same data

While we're at it, clean up the comments over cifs_calculate_signature
and add a note that the srv_mutex should be held when calling this

This patch seems to fix the problems for me, but I'm not clear on
whether it's the best approach. If it is, then this should probably
go to stable too.

Cc: Shirish Pargaonkar <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: clean up various nits in unicode routines (try #2)
Jeff Layton [Tue, 5 Apr 2011 19:02:37 +0000 (15:02 -0400)]
cifs: clean up various nits in unicode routines (try #2)

Minor revision to the original patch. Don't abuse the __le16 variable
on the stack by casting it to wchar_t and handing it off to char2uni.
Declare an actual wchar_t on the stack instead. This fixes a valid
sparse warning.

Fix the spelling of UNI_ASTERISK. Eliminate the unneeded len_remaining
variable in cifsConvertToUCS.

Also, as David Howells points out. We were better off making
cifsConvertToUCS *not* use put_unaligned_le16 since it means that we
can't optimize the mapped characters at compile time. Switch them
instead to use cpu_to_le16, and simply use put_unaligned to set them
in the string.

Reported-and-acked-by: David Howells <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: clean up length checks in check2ndT2
Jeff Layton [Thu, 31 Mar 2011 21:32:54 +0000 (17:32 -0400)]
cifs: clean up length checks in check2ndT2

Thus spake David Howells:

The code that follows this:

   remaining = total_data_size - data_in_this_rsp;
if (remaining == 0)
return 0;
else if (remaining < 0) {

generates better code if you drop the 'remaining' variable and compare
the values directly.

Clean it up per his recommendation...

Reported-and-acked-by: David Howells <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: set ra_pages in backing_dev_info
Jeff Layton [Fri, 25 Mar 2011 20:25:57 +0000 (16:25 -0400)]
cifs: set ra_pages in backing_dev_info

Commit 522440ed made cifs set backing_dev_info on the mapping attached
to new inodes. This change caused a fairly significant read performance
regression, as cifs started doing page-sized reads exclusively.

By virtue of the fact that they're allocated as part of cifs_sb_info by
kzalloc, the ra_pages on cifs BDIs get set to 0, which prevents any
readahead. This forces the normal read codepaths to use readpage instead
of readpages causing a four-fold increase in the number of read calls
with the default rsize.

Fix it by setting ra_pages in the BDI to the same value as that in the


Reported-and-Tested-by: Till <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: fix broken BCC check in is_valid_oplock_break
Jeff Layton [Wed, 16 Mar 2011 19:15:30 +0000 (15:15 -0400)]
cifs: fix broken BCC check in is_valid_oplock_break

The BCC is still __le16 at this point, and in any case we need to
use the get_bcc_le macro to make sure we don't hit alignment

Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: always do is_path_accessible check in cifs_mount
Jeff Layton [Mon, 14 Mar 2011 17:48:08 +0000 (13:48 -0400)]
cifs: always do is_path_accessible check in cifs_mount

Currently, we skip doing the is_path_accessible check in cifs_mount if
there is no prefixpath. I have a report of at least one server however
that allows a TREE_CONNECT to a share that has a DFS referral at its
root. The reporter in this case was using a UNC that had no prefixpath,
so the is_path_accessible check was not triggered and the box later hit
a BUG() because we were chasing a DFS referral on the root dentry for
the mount.

This patch fixes this by removing the check for a zero-length
prefixpath.  That should make the is_path_accessible check be done in
this situation and should allow the client to chase the DFS referral at
mount time instead.

Reported-and-Tested-by: Yogesh Sharma <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agovarious endian fixes to cifs
Steve French [Sun, 13 Mar 2011 05:08:25 +0000 (05:08 +0000)]
various endian fixes to cifs

make modules C=2 M=fs/cifs CF=-D__CHECK_ENDIAN__

Found for example:

 CHECK   fs/cifs/cifssmb.c
fs/cifs/cifssmb.c:728:22: warning: incorrect type in assignment (different base types)
fs/cifs/cifssmb.c:728:22:    expected unsigned short [unsigned] [usertype] Tid
fs/cifs/cifssmb.c:728:22:    got restricted __le16 [usertype] <noident>
fs/cifs/cifssmb.c:1883:45: warning: incorrect type in assignment (different base types)
fs/cifs/cifssmb.c:1883:45:    expected long long [signed] [usertype] fl_start
fs/cifs/cifssmb.c:1883:45:    got restricted __le64 [usertype] start
fs/cifs/cifssmb.c:1884:54: warning: restricted __le64 degrades to integer
fs/cifs/cifssmb.c:1885:58: warning: restricted __le64 degrades to integer
fs/cifs/cifssmb.c:1886:43: warning: incorrect type in assignment (different base types)
fs/cifs/cifssmb.c:1886:43:    expected unsigned int [unsigned] fl_pid
fs/cifs/cifssmb.c:1886:43:    got restricted __le32 [usertype] pid

In checking new smb2 code for missing endian conversions, I noticed
some endian errors had crept in over the last few releases into the
cifs code (symlink, ntlmssp, posix lock, and also a less problematic warning
in fscache).  A followon patch will address a few smb2 endian

Reviewed-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agoElminate sparse __CHECK_ENDIAN__ warnings on port conversion
Steve French [Sun, 13 Mar 2011 18:55:55 +0000 (18:55 +0000)]
Elminate sparse __CHECK_ENDIAN__ warnings on port conversion

Ports are __be16 not unsigned short int

Eliminates the remaining fixable endian warnings:

~/cifs-2.6$ make modules C=1 M=fs/cifs CF=-D__CHECK_ENDIAN__
  CHECK   fs/cifs/connect.c
fs/cifs/connect.c:2408:23: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2408:23:    expected unsigned short *sport
fs/cifs/connect.c:2408:23:    got restricted __be16 *<noident>
fs/cifs/connect.c:2410:23: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2410:23:    expected unsigned short *sport
fs/cifs/connect.c:2410:23:    got restricted __be16 *<noident>
fs/cifs/connect.c:2416:24: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2416:24:    expected unsigned short [unsigned] [short] <noident>
fs/cifs/connect.c:2416:24:    got restricted __be16 [usertype] <noident>
fs/cifs/connect.c:2423:24: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2423:24:    expected unsigned short [unsigned] [short] <noident>
fs/cifs/connect.c:2423:24:    got restricted __be16 [usertype] <noident>
fs/cifs/connect.c:2326:23: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2326:23:    expected unsigned short [unsigned] sport
fs/cifs/connect.c:2326:23:    got restricted __be16 [usertype] sin6_port
fs/cifs/connect.c:2330:23: warning: incorrect type in assignment (different base types)
fs/cifs/connect.c:2330:23:    expected unsigned short [unsigned] sport
fs/cifs/connect.c:2330:23:    got restricted __be16 [usertype] sin_port
fs/cifs/connect.c:2394:22: warning: restricted __be16 degrades to integer

Signed-off-by: Steve French <>
11 years agoMax share size is too small
Steve French [Tue, 8 Mar 2011 05:51:19 +0000 (05:51 +0000)]
Max share size is too small

Max share name was set to 64, and (at least for Windows)
can be 80.

Signed-off-by: Steve French <>
11 years agoAllow user names longer than 32 bytes
Steve French [Fri, 25 Feb 2011 07:11:56 +0000 (01:11 -0600)]
Allow user names longer than 32 bytes

We artificially limited the user name to 32 bytes, but modern servers handle
larger.  Set the maximum length to a reasonable 256, and make the user name
string dynamically allocated rather than a fixed size in session structure.
Also clean up old checkpatch warning.

Signed-off-by: Steve French <>
11 years agocifs: replace /proc/fs/cifs/Experimental with a module parm
Jeff Layton [Wed, 23 Feb 2011 01:17:19 +0000 (20:17 -0500)]
cifs: replace /proc/fs/cifs/Experimental with a module parm

This flag currently only affects whether we allow "zero-copy" writes
with signing enabled. Typically we map pages in the pagecache directly
into the write request. If signing is enabled however and the contents
of the page change after the signature is calculated but before the
write is sent then the signature will be wrong. Servers typically
respond to this by closing down the socket.

Still, this can provide a performance benefit so the "Experimental" flag
was overloaded to allow this. That's really not a good place for this
option however since it's not clear what that flag does.

Move that flag instead to a new module parameter that better describes
its purpose. That's also better since it can be set at module insertion
time by configuring modprobe.d.

Reviewed-by: Suresh Jayaraman <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agocifs: check for private_data before trying to put it
Jeff Layton [Tue, 5 Apr 2011 23:23:47 +0000 (16:23 -0700)]
cifs: check for private_data before trying to put it

cifs_close doesn't check that the filp->private_data is non-NULL before
trying to put it. That can cause an oops in certain error conditions
that can occur on open or lookup before the private_data is set.

Reported-by: Ben Greear <>
CC: Stable <>
Signed-off-by: Jeff Layton <>
Signed-off-by: Steve French <>
11 years agoLinux 2.6.39-rc3 v2.6.39-rc3
Linus Torvalds [Tue, 12 Apr 2011 00:21:51 +0000 (17:21 -0700)]
Linux 2.6.39-rc3

11 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 11 Apr 2011 22:48:57 +0000 (15:48 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  xfs: use proper interfaces for on-stack plugging
  xfs: fix xfs_debug warnings
  xfs: fix variable set but not used warnings
  xfs: convert log tail checking to a warning
  xfs: catch bad block numbers freeing extents.
  xfs: push the AIL from memory reclaim and periodic sync
  xfs: clean up code layout in xfs_trans_ail.c
  xfs: convert the xfsaild threads to a workqueue
  xfs: introduce background inode reclaim work
  xfs: convert ENOSPC inode flushing to use new syncd workqueue
  xfs: introduce a xfssyncd workqueue
  xfs: fix extent format buffer allocation size
  xfs: fix unreferenced var error in xfs_buf.c

Also, applied patch from Tony Luck that fixes ia64:
  xfs_destroy_workqueues() should not be tagged with__exit
in the branch before merging.

11 years agoxfs_destroy_workqueues() should not be tagged with__exit
Luck, Tony [Mon, 11 Apr 2011 19:06:12 +0000 (12:06 -0700)]
xfs_destroy_workqueues() should not be tagged with__exit

ia64 throws away .exit sections for the built-in CONFIG case, so routines
that are used in other circumstances should not be tagged as __exit.

Signed-off-by: Tony Luck <>
Reviewed-by: Christoph Hellwig <>
Signed-off-by: Alex Elder <>
Signed-off-by: Linus Torvalds <>
11 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Mon, 11 Apr 2011 22:45:47 +0000 (15:45 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://
  ext4: fix data corruption regression by reverting commit 6de9843dab3f
  ext4: Allow indirect-block file to grow the file size to max file size
  ext4: allow an active handle to be started when freezing
  ext4: sync the directory inode in ext4_sync_parent()
  ext4: init timer earlier to avoid a kernel panic in __save_error_info
  jbd2: fix potential memory leak on transaction commit
  ext4: fix a double free in ext4_register_li_request
  ext4: fix credits computing for indirect mapped files
  ext4: remove unnecessary [cm]time update of quota file
  jbd2: move bdget out of critical section

11 years agoMerge branch 'for-2.6.39' of git://
Linus Torvalds [Mon, 11 Apr 2011 22:45:17 +0000 (15:45 -0700)]
Merge branch 'for-2.6.39' of git://

* 'for-2.6.39' of git://
  nfsd4: fix oops on lock failure
  nfsd: fix auth_domain reference leak on nlm operations

11 years agoMerge branch 'spi/merge' of git://
Linus Torvalds [Mon, 11 Apr 2011 22:44:38 +0000 (15:44 -0700)]
Merge branch 'spi/merge' of git://

* 'spi/merge' of git://
  dt/fsldma: fix build warning caused by of_platform_device changes
  spi: Fix race condition in stop_queue()
  gpio/pch_gpio: Fix output value of pch_gpio_direction_output()
  gpio/ml_ioh_gpio: Fix output value of ioh_gpio_direction_output()
  gpio/pca953x: fix error handling path in probe() call

11 years agofix XEN_SAVE_RESTORE Kconfig dependencies
Shriram Rajagopalan [Mon, 11 Apr 2011 20:54:48 +0000 (22:54 +0200)]
fix XEN_SAVE_RESTORE Kconfig dependencies

Remove XEN_SAVE_RESTORE dependency from PM_SLEEP.

Signed-off-by: Shriram Rajagopalan <>
Acked-by: Ian Campbell <>
Signed-off-by: Rafael J. Wysocki <>