9 years agogen_init_cpio: Avoid race between call to stat() and call to open()
Jesper Juhl [Fri, 24 Dec 2010 20:28:56 +0000 (21:28 +0100)]
gen_init_cpio: Avoid race between call to stat() and call to open()

In usr/gen_init_cpio.c::cpio_mkfile() a call to stat() is made based on
pathname, subsequently the file is open()'ed and then the value of the
initial stat() call is used to allocate a buffer. This is not safe since
the file may change between the call to stat() and the call to open().
Safer to just open() the file and then do fstat() using the filedescriptor
returned by open.

Signed-off-by: Jesper Juhl <>
Acked-by: Jeff Garzik <>
Signed-off-by: Michal Marek <>
9 years agomodpost: Fix address calculation in reloc_location()
Olof Johansson [Fri, 10 Dec 2010 08:09:23 +0000 (02:09 -0600)]
modpost: Fix address calculation in reloc_location()

This patch fixes a segfault in modpost that is observed when the gold
linker is used to link the input objects.

The problem is that reloc_location (modpost.c) is computing the
address of the relocation target incorrectly. Here, elf->hdr points
to the beginning of the ELF file in memory, sechdr points to the
relocation section header, section is the index of the section
being relocated, and sechdrs[section].sh_offset would be the offset
of that section, relative to the beginning of the ELF file. Adding
elf->hdr + sechdrs[section].sh_offset gives you the address of the
beginning of the section, and adding r->r_offset to that gives you the
address of the location to be relocated. You do not need to subtract
sechdrs[section].sh_addr from that -- the result of this is an address
outside the file, and causes the segfault when addend_386_rel tries to
dereference it.

This bug is not observed when GNU ld is used to link the inputs. The
object file ubuntu/omnibook/omnibook.o is the result of an ld -r of
several other files.  When GNU ld does an ld -r, it sets the vaddr
field for each section to 0, but gold lays out the section addresses
sequentially instead:

Section Headers:
 [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
 [ 0]                   NULL            00000000 000000 000000 00      0   0  0
 [ 1] .text             PROGBITS        00000000 000034 004794 00  AX  0   0  4
 [ 2] .data             PROGBITS        0000b9d0 0047c8 0009c0 00  WA  0   0  4
 [ 3] .bss              NOBITS          000162f8 005188 00013c 00  WA  0   0  4
 [ 4] .rodata.str1.1    PROGBITS        00004f2d 0052c4 001b1a 01 AMS  0   0  1
 [ 5] .init.text        PROGBITS        00004794 006dde 0005fa 00  AX  0   0  1
 [ 6] .exit.text        PROGBITS        00004d8e 0073d8 00018a 00  AX  0   0  1

So the bug in the tool remained undiscovered because the section's vaddr
always happened to be 0.

Signed-off-by: Raymes Khoury <>
Signed-off-by: Olof Johansson <>
Signed-off-by: Michal Marek <>
9 years agoMake fixdep error handling more explicit
Ben Gamari [Wed, 22 Dec 2010 18:30:14 +0000 (13:30 -0500)]
Make fixdep error handling more explicit

Also add missing error handling to fstat call

Signed-off-by: Ben Gamari <>
Signed-off-by: Michal Marek <>
9 years agochecksyscalls: Fix stand-alone usage
Geert Uytterhoeven [Wed, 25 Aug 2010 10:22:40 +0000 (12:22 +0200)]
checksyscalls: Fix stand-alone usage

The usage help in the comments
  - refers to the wrong script name,
  - doesn't mention that $srctree must be set.

Hence correct the script name, and derive the source tree path from the script
path, so we no longer need to rely on $srctree being set by the caller.

Signed-off-by: Geert Uytterhoeven <>
Acked-by: Sam Ravnborg <>
Signed-off-by: Michal Marek <>
9 years agomodpost: Put .zdebug* section on white list
H.J. Lu [Thu, 16 Dec 2010 01:11:22 +0000 (17:11 -0800)]
modpost: Put .zdebug* section on white list

"as --compress-debug-sections" will generate compressed debug sections
with section names ".zdebug*".  This patch puts .zdebug* section on
white list.

Signed-off-by: H.J. Lu <>
Signed-off-by: Michal Marek <>
9 years agokbuild: fix interaction of CONFIG_IKCONFIG and KCONFIG_CONFIG
Ben Gardiner [Tue, 14 Dec 2010 16:39:44 +0000 (11:39 -0500)]
kbuild: fix interaction of CONFIG_IKCONFIG and KCONFIG_CONFIG

If you try to build a kernel with KCONFIG_CONFIG set (to a value
not equal to .config) and that config sets CONFIG_IKCONFIG then the
build will fail with:

make[1]: *** No rule to make target `.config', needed by \
`kernel/config_data.gz'.  Stop.

because the kernel/Makefile contains a direct reference to .config.

This issue has been present since the introduction of KCONFIG_CONFIG
in 14cdd3c402bf7c66f0bcd76e290f0770a54a4b21.

Signed-off-by: Ben Gardiner <>
CC: Roman Zippel <>
CC: Michal Marek <>
Reviewed-by: Michal Marek <>
Signed-off-by: Michal Marek <>
9 years agokbuild: export linux/{a.out,kvm,kvm_para}.h on headers_install_all
Kirill A. Shutemov [Mon, 13 Dec 2010 17:10:29 +0000 (19:10 +0200)]
kbuild: export linux/{a.out,kvm,kvm_para}.h on headers_install_all

Export linux/a.out.h, linux/kvm.h and linux/kvm_para.h on
headers_install_all if at least one architecture has appropriate files
in arch-dependent headers.

Signed-off-by: Kirill A. Shutemov <>
Signed-off-by: Michal Marek <>
9 years agokbuild: introduce HDR_ARCH_LIST for headers_install_all
Kirill A. Shutemov [Mon, 13 Dec 2010 17:10:28 +0000 (19:10 +0200)]
kbuild: introduce HDR_ARCH_LIST for headers_install_all

Using HDR_ARCH_LIST you can specify subset of architectures you want to get
headers for.

Signed-off-by: Kirill A. Shutemov <>
Signed-off-by: Michal Marek <>
9 years agoMerge commit 'v2.6.37-rc1' into kbuild/kbuild
Michal Marek [Tue, 14 Dec 2010 21:01:55 +0000 (22:01 +0100)]
Merge commit 'v2.6.37-rc1' into kbuild/kbuild

9 years agoheaders_install: check exit status of unifdef
Mike Frysinger [Wed, 24 Nov 2010 00:54:02 +0000 (19:54 -0500)]
headers_install: check exit status of unifdef

If unifdef fails for any reason (like segfaulting), we should be aborting
the install steps.  So check its exit status in this unlikely scenario.

Reported-by: Diego Elio Pettenò <>
Signed-off-by: Mike Frysinger <>
Signed-off-by: Michal Marek <>
9 years agogen_init_cpio: remove leading `/' from file names
Thomas Chou [Wed, 6 Oct 2010 07:13:53 +0000 (15:13 +0800)]
gen_init_cpio: remove leading `/' from file names

When we extracted the generated cpio archive using "cpio -id" command,
it complained,

cpio: Removing leading `/' from member names
cpio: Removing leading `/' from member names
cpio: Removing leading `/' from member names

It is worse with the latest "cpio" or "pax", which tries to overwrite
the host file system with the leading '/'.

So the leading '/' of file names should be removed. This is consistent
with the initramfs come with major distributions such as Fedora or
Debian, etc.

Signed-off-by: Thomas Chou <>
Acked-by: Mike Frysinger<>
Signed-off-by: Michal Marek <>
9 years agoscripts/genksyms: fix header usage
Arnaud Lacombe [Mon, 8 Nov 2010 23:31:53 +0000 (18:31 -0500)]
scripts/genksyms: fix header usage

FreeBSD does not like <malloc.h> when __STDC__ is defined, use the standard
<stdlib.h> instead.

Signed-off-by: Arnaud Lacombe <>
Signed-off-by: Michal Marek <>
9 years agofixdep: use hash table instead of a single array
Eric Dumazet [Tue, 9 Nov 2010 15:29:27 +0000 (16:29 +0100)]
fixdep: use hash table instead of a single array

I noticed fixdep uses ~2% of cpu time in kernel build, in function

fixdep spends a lot of cpu cycles in linear searches in its internal
string array. With about 400 stored strings per dep file, this begins to
be noticeable.

Convert fixdep to use a hash table.

kbuild results on my x86_64 allmodconfig

Before patch :

real 10m30.414s
user 61m51.456s
sys 8m28.200s

real 10m12.334s
user 61m50.236s
sys 8m30.448s

real 10m42.947s
user 61m50.028s
sys 8m32.380s


real 10m8.180s
user 61m22.506s
sys 8m32.384s

real 10m35.039s
user 61m21.654s
sys 8m32.212s

real 10m14.487s
user 61m23.498s
sys 8m32.312s

Signed-off-by: Eric Dumazet <>
Signed-off-by: Michal Marek <>
9 years agoLinux 2.6.37-rc1 v2.6.37-rc1
Linus Torvalds [Mon, 1 Nov 2010 11:54:12 +0000 (07:54 -0400)]
Linux 2.6.37-rc1

9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 1 Nov 2010 11:53:19 +0000 (07:53 -0400)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  CRIS: Add paths for CRISv10 serial driver
  CRIS: Fix RS485 delay handling.
  Add missing "struct" to in sizeof.

9 years agoMerge branch 'next-spi' of git://
Linus Torvalds [Mon, 1 Nov 2010 11:50:43 +0000 (07:50 -0400)]
Merge branch 'next-spi' of git://

* 'next-spi' of git://
  spi/pl022: fix erroneous platform data in U300
  spi: fixed odd static string conventions in core code
  spi/bfin_spi: only request GPIO on first load
  spi/bfin_spi: handle error/status changes after data interrupts
  spi: enable spi_board_info to be registered after spi_master

9 years agoCRIS: Add paths for CRISv10 serial driver
Jesper Nilsson [Mon, 1 Nov 2010 10:01:14 +0000 (11:01 +0100)]
CRIS: Add paths for CRISv10 serial driver

Signed-off-by: Jesper Nilsson <>
9 years agospi/pl022: fix erroneous platform data in U300
Linus Walleij [Thu, 21 Oct 2010 19:05:25 +0000 (21:05 +0200)]
spi/pl022: fix erroneous platform data in U300

This fixes an erroneous use of LSB first in the U300 machine, the
PL022 used in U300 is a standard ARM core that doesn't support this
bit so it should never have been set.

Cc: Kevin Wells <>OA
Signed-off-by: Linus Walleij <>
Signed-off-by: Grant Likely <>
9 years agoInput: ir-keytable - fix uninitialized variable warning
Dmitry Torokhov [Sun, 31 Oct 2010 22:18:42 +0000 (15:18 -0700)]
Input: ir-keytable - fix uninitialized variable warning

We were forgetting to set up proper return value in success path causing
ir_getkeycode() to fail intermittently:

drivers/media/IR/ir-keytable.c: In function 'ir_getkeycode':
drivers/media/IR/ir-keytable.c:363: warning: 'retval' may be used
uninitialized in this function

Reported-by: Stefan Richter <>
Signed-off-by: Dmitry Torokhov <>
Signed-off-by: Linus Torvalds <>
9 years agoMerge branch 'i2c-for-linus' of git://
Linus Torvalds [Mon, 1 Nov 2010 01:03:23 +0000 (21:03 -0400)]
Merge branch 'i2c-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://
  i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers
  i2c-i801: Handle multiple instances instead of keeping global state
  i2c-i801: Add Intel Patsburg device ID
  i2c: Drop unused I2C_CLASS_TV flags

9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 1 Nov 2010 01:02:39 +0000 (21:02 -0400)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://
  Input: appletouch - remove extra KERN_DEBUG use from dprintk
  Input: bu21013_ts - fix null dereference in error handling
  Input: ad7879 - prevent invalid finger data reports

9 years agoMerge git://
Linus Torvalds [Mon, 1 Nov 2010 00:43:12 +0000 (20:43 -0400)]
Merge git://git./linux/kernel/git/jejb/scsi-misc-2.6

* git:// (70 commits)
  [SCSI] pmcraid: add support for set timestamp command and other fixes
  [SCSI] pmcraid: remove duplicate struct member
  [SCSI] qla4xxx: Fix cmd check in qla4xxx_cmd_wait
  [SCSI] megaraid_sas: Version and documentation update
  [SCSI] megaraid_sas: Add three times Online controller reset
  [SCSI] megaraid_sas: Add input parameter for max_sectors
  [SCSI] megaraid_sas: support devices update flag
  [SCSI] libosd: write/read_sg_kern API
  [SCSI] libosd: Support for scatter gather write/read commands
  [SCSI] libosd: Free resources in reverse order of allocation
  [SCSI] libosd: Fix bug in attr_page handling
  [SCSI] lpfc 8.3.18: Update lpfc driver version to 8.3.18
  [SCSI] lpfc 8.3.18: Add new WQE support
  [SCSI] lpfc 8.3.18: Fix critical errors
  [SCSI] lpfc 8.3.18: Adapter Shutdown and Unregistration cleanup
  [SCSI] lpfc 8.3.18: Add logic to detect last devloss timeout
  [SCSI] lpfc 8.3.18: Add support of received ELS commands
  [SCSI] lpfc 8.3.18: FC/FCoE Discovery fixes
  [SCSI] ipr: add definitions for a new adapter
  [SCSI] bfa: fix comments for c files

9 years agoMerge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel...
Linus Torvalds [Mon, 1 Nov 2010 00:40:24 +0000 (20:40 -0400)]
Merge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-core-for-linus' of git://
  genirq: Fix up irq_node() for irq_data changes.
  genirq: Add single IRQ reservation helper
  genirq: Warn if enable_irq is called before irq is set up

* 'core-locking-for-linus' of git://
  semaphore: Remove mutex emulation
  staging: Final semaphore cleanup
  jbd2: Convert jbd2_slab_create_sem to mutex
  hpfs: Convert sbi->hpfs_creation_de to mutex

Fix up trivial change/delete conflicts with deleted 'dream' drivers

9 years agoi2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers
David Woodhouse [Sun, 31 Oct 2010 20:07:00 +0000 (21:07 +0100)]
i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers

These are the extra 'Integrated Device Function' SMBus controllers found
on the Patsburg chipset. Mention the absence of slave mode support.

Signed-off-by: David Woodhouse <>
Signed-off-by: Jean Delvare <>
9 years agoi2c-i801: Handle multiple instances instead of keeping global state
David Woodhouse [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c-i801: Handle multiple instances instead of keeping global state

It's poor form to keep driver state in global variables rather than
per-instance. It never really mattered in practice when there was only
one controller on the chipset, but the latest chipsets do have more
than one controller, so now we care.

Signed-off-by: David Woodhouse <>
Signed-off-by: Jean Delvare <>
9 years agoi2c-i801: Add Intel Patsburg device ID
Seth Heasley [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c-i801: Add Intel Patsburg device ID

Add support for the Intel Patsburg PCH SMBus Controller.

Signed-off-by: Seth Heasley <>
Signed-off-by: Jean Delvare <>
9 years agoi2c: Drop unused I2C_CLASS_TV flags
Jean Delvare [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c: Drop unused I2C_CLASS_TV flags

There are no users left for I2C_CLASS_TV_ANALOG and
I2C_CLASS_TV_DIGITAL, so we can get rid of them.

Signed-off-by: Jean Delvare <>
9 years agoInput: appletouch - remove extra KERN_DEBUG use from dprintk
Joe Perches [Sun, 31 Oct 2010 00:19:49 +0000 (17:19 -0700)]
Input: appletouch - remove extra KERN_DEBUG use from dprintk

Signed-off-by: Joe Perches <>
Signed-off-by: Dmitry Torokhov <>
9 years agolocks: remove fl_copy_lock lock_manager operation
Christoph Hellwig [Sun, 31 Oct 2010 12:35:31 +0000 (08:35 -0400)]
locks: remove fl_copy_lock lock_manager operation

This one was only used for a nasty hack in nfsd, which has recently
been removed.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Linus Torvalds <>
9 years agolocks: let the caller free file_lock on ->setlease failure
Christoph Hellwig [Sun, 31 Oct 2010 12:35:10 +0000 (08:35 -0400)]
locks: let the caller free file_lock on ->setlease failure

The caller allocated it, the caller should free it.

The only issue so far is that we could change the flp pointer even on an
error return if the fl_change callback failed.  But we can simply move
the flp assignment after the fl_change invocation, as the callers don't
care about the flp return value if the setlease call failed.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Linus Torvalds <>
9 years agoinitramfs: Fix initramfs size for 32-bit arches
Geert Uytterhoeven [Sun, 31 Oct 2010 09:56:23 +0000 (10:56 +0100)]
initramfs: Fix initramfs size for 32-bit arches

Commit ffe8018c3424 ("initramfs: fix initramfs size calculation") broke
32-bit big-endian arches like (on ARAnyM):

    VFS: Cannot open root device "hda1" or unknown-block(3,1)
    Please append a correct "root=" boot option; here are the available partitions:
    fe80         1059408 nfhd8  (driver?)
      fe81          921600 nfhd8p1 00000000-0000-0000-0000-000000000nfhd8p1
      fe82          137807 nfhd8p2 00000000-0000-0000-0000-000000000nfhd8p2
    0200            3280 fd0  (driver?)
    0201            3280 fd1  (driver?)
    0300         1059408 hda  driver: ide-gd
      0301          921600 hda1 00000000-0000-0000-0000-000000000hda1
      0302          137807 hda2 00000000-0000-0000-0000-000000000hda2
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)

As pointed out by Kerstin Jonsson <>, this
is due to CONFIG_32BIT not being defined, so the initramfs size field is
done as a 64-bit quad.  On little-endian (like x86) this doesn matter,
but on a big-endian machine the 32-bit reads will see the (zero) high

Only mips, s390, and score set CONFIG_32BIT for 32-bit builds, so fix it for
all other 32-bit arches by inverting the logic and testing for CONFIG_64BIT,
which should be defined on all 64-bit arches.

Signed-off-by: Geert Uytterhoeven <>
[ I think we should just make it "u64" on all architectures and get
  rid of the whole #ifdef CONFIG_xxBIT   - Linus ]
Signed-off-by: Linus Torvalds <>
9 years agoMerge git://
Linus Torvalds [Sun, 31 Oct 2010 01:42:58 +0000 (18:42 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://
  isdn: mISDN: socket: fix information leak to userland
  netdev: can: Change mail address of Hans J. Koch
  pcnet_cs: add new_id
  net: Truncate recvfrom and sendto length to INT_MAX.
  RDS: Let rds_message_alloc_sgs() return NULL
  RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace
  RDS: Clean up error handling in rds_cmsg_rdma_args
  RDS: Return -EINVAL if rds_rdma_pages returns an error
  net: fix rds_iovec page count overflow
  can: pch_can: fix section mismatch warning by using a whitelisted name
  can: pch_can: fix sparse warning
  netxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe
  ip_gre: fix fallback tunnel setup
  vmxnet: trivial annotation of protocol constant
  vmxnet3: remove unnecessary byteswapping in BAR writing macros
  ipv6/udp: report SndbufErrors and RcvbufErrors
  phy/marvell: rename 88ec048 to 88e1318s and fix mscr1 addr

9 years agonfsd4: initialize delegation pointer to lease
J. Bruce Fields [Sat, 30 Oct 2010 21:31:16 +0000 (17:31 -0400)]
nfsd4: initialize delegation pointer to lease

The NFSv4 server was initializing the dp->dl_flock pointer by the
somewhat ridiculous method of a locks_copy_lock callback.

Now that setlease uses the passed-in lock instead of doing a copy,
dl_flock no longer gets set, resulting in the lock leaking on delegation
release, and later possible hangs (among other problems).

So, initialize dl_flock and get rid of the callback.

Signed-off-by: J. Bruce Fields <>
Acked-by: Arnd Bergmann <>
Signed-off-by: Linus Torvalds <>
9 years agolocks: fix setlease methods to free passed-in lock
J. Bruce Fields [Sat, 30 Oct 2010 21:31:15 +0000 (17:31 -0400)]
locks: fix setlease methods to free passed-in lock

We modified setlease to require the caller to allocate the new lease in
the case of creating a new lease, but forgot to fix up the filesystem

Cc: Steven Whitehouse <>
Cc: Steve French <>
Cc: Trond Myklebust <>
Signed-off-by: J. Bruce Fields <>
Acked-by: Arnd Bergmann <>
Signed-off-by: Linus Torvalds <>
9 years agolocks: fix leaks on setlease errors
J. Bruce Fields [Sat, 30 Oct 2010 21:31:14 +0000 (17:31 -0400)]
locks: fix leaks on setlease errors

We're depending on setlease to free the passed-in lease on failure.

Signed-off-by: J. Bruce Fields <>
Acked-by: Arnd Bergmann <>
Signed-off-by: Linus Torvalds <>
9 years agolocks: prevent ENOMEM on lease unlock
J. Bruce Fields [Sat, 30 Oct 2010 21:31:13 +0000 (17:31 -0400)]
locks: prevent ENOMEM on lease unlock

Removing a lock shouldn't require any allocations; a failure due to
ENOMEM leaves the caller with a choice between retrying or giving up and
leaking an unused lease.

Next we should split the other lease calls into add and delete cases.
I wanted to start with just the bugfix.

Signed-off-by: J. Bruce Fields <>
Acked-by: Arnd Bergmann <>
Signed-off-by: Linus Torvalds <>
9 years agodrivers/media/IR/ir-keytable.c: fix binary search
David Härdeman [Sat, 30 Oct 2010 20:17:44 +0000 (22:17 +0200)]
drivers/media/IR/ir-keytable.c: fix binary search

The input-large-scancode patches changed the binary search in
drivers/media/IR/ir-keytable.c to use unsigned integers, but
signed integers are actually necessary for the algorithm to work.

Signed-off-by: David Härdeman <>
Cc: Dmitry Torokhov <>
Signed-off-by: Linus Torvalds <>
9 years agoisdn: mISDN: socket: fix information leak to userland
Kulikov Vasiliy [Fri, 29 Oct 2010 23:04:33 +0000 (23:04 +0000)]
isdn: mISDN: socket: fix information leak to userland

Structure mISDN_devinfo is copied to userland with the field "name"
that has the last elements unitialized.  It leads to leaking of
contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <>
Signed-off-by: David S. Miller <>
9 years agonetdev: can: Change mail address of Hans J. Koch
Hans J. Koch [Fri, 29 Oct 2010 12:33:57 +0000 (12:33 +0000)]
netdev: can: Change mail address of Hans J. Koch

My old mail address doesn't exist anymore. This changes all occurrences
to my new address.

Signed-off-by: Hans J. Koch <>
Signed-off-by: David S. Miller <>
9 years agopcnet_cs: add new_id
Ken Kawasaki [Fri, 29 Oct 2010 12:17:51 +0000 (12:17 +0000)]
pcnet_cs: add new_id

    add new_id: "corega Ether CF-TD" 10Base-T PCMCIA card.

Signed-off-by: Ken Kawasaki <>
Signed-off-by: David S. Miller <>
9 years agonet: Truncate recvfrom and sendto length to INT_MAX.
Linus Torvalds [Sat, 30 Oct 2010 23:43:10 +0000 (16:43 -0700)]
net: Truncate recvfrom and sendto length to INT_MAX.

Signed-off-by: Linus Torvalds <>
Signed-off-by: David S. Miller <>
9 years agoRDS: Let rds_message_alloc_sgs() return NULL
Andy Grover [Thu, 28 Oct 2010 15:40:59 +0000 (15:40 +0000)]
RDS: Let rds_message_alloc_sgs() return NULL

Even with the previous fix, we still are reading the iovecs once
to determine SGs needed, and then again later on. Preallocating
space for sg lists as part of rds_message seemed like a good idea
but it might be better to not do this. While working to redo that
code, this patch attempts to protect against userspace rewriting
the rds_iovec array between the first and second accesses.

The consequences of this would be either a too-small or too-large
sg list array. Too large is not an issue. This patch changes all
callers of message_alloc_sgs to handle running out of preallocated
sgs, and fail gracefully.

Signed-off-by: Andy Grover <>
Signed-off-by: David S. Miller <>
9 years agoRDS: Copy rds_iovecs into kernel memory instead of rereading from userspace
Andy Grover [Thu, 28 Oct 2010 15:40:58 +0000 (15:40 +0000)]
RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace

Change rds_rdma_pages to take a passed-in rds_iovec array instead
of doing copy_from_user itself.

Change rds_cmsg_rdma_args to copy rds_iovec array once only. This
eliminates the possibility of userspace changing it after our
sanity checks.

Implement stack-based storage for small numbers of iovecs, based
on net/socket.c, to save an alloc in the extremely common case.

Although this patch reduces iovec copies in cmsg_rdma_args to 1,
we still do another one in rds_rdma_extra_size. Getting rid of
that one will be trickier, so it'll be a separate patch.

Signed-off-by: Andy Grover <>
Signed-off-by: David S. Miller <>
9 years agoRDS: Clean up error handling in rds_cmsg_rdma_args
Andy Grover [Thu, 28 Oct 2010 15:40:57 +0000 (15:40 +0000)]
RDS: Clean up error handling in rds_cmsg_rdma_args

We don't need to set ret = 0 at the end -- it's initialized to 0.

Also, don't increment s_send_rdma stat if we're exiting with an

Signed-off-by: Andy Grover <>
Signed-off-by: David S. Miller <>
9 years agoRDS: Return -EINVAL if rds_rdma_pages returns an error
Andy Grover [Thu, 28 Oct 2010 15:40:56 +0000 (15:40 +0000)]
RDS: Return -EINVAL if rds_rdma_pages returns an error

rds_cmsg_rdma_args would still return success even if rds_rdma_pages
returned an error (or overflowed).

Signed-off-by: Andy Grover <>
Signed-off-by: David S. Miller <>
9 years agonet: fix rds_iovec page count overflow
Linus Torvalds [Thu, 28 Oct 2010 15:40:55 +0000 (15:40 +0000)]
net: fix rds_iovec page count overflow

As reported by Thomas Pollet, the rdma page counting can overflow.  We
get the rdma sizes in 64-bit unsigned entities, but then limit it to
UINT_MAX bytes and shift them down to pages (so with a possible "+1" for
an unaligned address).

So each individual page count fits comfortably in an 'unsigned int' (not
even close to overflowing into signed), but as they are added up, they
might end up resulting in a signed return value. Which would be wrong.

Catch the case of tot_pages turning negative, and return the appropriate
error code.

Reported-by: Thomas Pollet <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Andy Grover <>
Signed-off-by: David S. Miller <>
9 years agocan: pch_can: fix section mismatch warning by using a whitelisted name
Marc Kleine-Budde [Sat, 30 Oct 2010 23:28:16 +0000 (16:28 -0700)]
can: pch_can: fix section mismatch warning by using a whitelisted name

This patch fixes the following section mismatch warning:

WARNING: drivers/net/can/pch_can.o(.data+0x18):
Section mismatch in reference from the variable pch_can_pcidev
to the variable .devinit.rodata:pch_pci_tbl
The variable pch_can_pcidev references
the variable __devinitconst pch_pci_tbl

This is actually a false positive which is fixed by giving the offending
variable a whitelisted name, it's renamed to "pch_can_pci_driver".
This makes sense because the variable is of the type "struct pci_driver".

Signed-off-by: Marc Kleine-Budde <>
Acked-by: Uwe Kleine-König <>
Signed-off-by: David S. Miller <>
9 years agocan: pch_can: fix sparse warning
Marc Kleine-Budde [Sat, 30 Oct 2010 23:27:48 +0000 (16:27 -0700)]
can: pch_can: fix sparse warning

This patch fixes the following sparse warning:

drivers/net/can/pch_can.c:231:26: warning: incorrect type in argument 1 (different address spaces)
drivers/net/can/pch_can.c:231:26:    expected unsigned int [usertype] *addr
drivers/net/can/pch_can.c:231:26:    got unsigned int [noderef] <asn:2>*<noident>

Let pch_can_bit_{set,clear} first parameter be a void __iomem pointer.

Signed-off-by: Marc Kleine-Budde <>
Signed-off-by: David S. Miller <>
9 years agonetxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe
Denis Kirjanov [Sat, 30 Oct 2010 23:24:25 +0000 (16:24 -0700)]
netxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe

We should not stop the egress queue during probe because it is wrong.

Signed-off-by: Denis Kirjanov <>
Signed-off-by: David S. Miller <>
9 years agoip_gre: fix fallback tunnel setup
Eric Dumazet [Sat, 30 Oct 2010 23:21:28 +0000 (16:21 -0700)]
ip_gre: fix fallback tunnel setup

Before making the fallback tunnel visible to lookups, we should make
sure it is completely setup, once ipgre_tunnel_init() had been called
and tstats per_cpu pointer allocated.

move rcu_assign_pointer(ign->tunnels_wc[0], tunnel); from
ipgre_fb_tunnel_init() to ipgre_init_net()

Based on a patch from Pavel Emelyanov

Reported-by: Pavel Emelyanov <>
Signed-off-by: Eric Dumazet <>
Acked-by: Pavel Emelyanov <>
Signed-off-by: David S. Miller <>
9 years agovmxnet: trivial annotation of protocol constant
Harvey Harrison [Sat, 30 Oct 2010 23:19:45 +0000 (16:19 -0700)]
vmxnet: trivial annotation of protocol constant

Noticed by sparse:
drivers/net/vmxnet3/vmxnet3_drv.c:876:38: warning: cast from restricted __be16
drivers/net/vmxnet3/vmxnet3_drv.c:876:38: warning: cast from restricted __be16
drivers/net/vmxnet3/vmxnet3_drv.c:876:24: warning: restricted __be16 degrades to integer

Signed-off-by: Harvey Harrison <>
Signed-off-by: David S. Miller <>
9 years agovmxnet3: remove unnecessary byteswapping in BAR writing macros
Harvey Harrison [Sat, 30 Oct 2010 23:19:18 +0000 (16:19 -0700)]
vmxnet3: remove unnecessary byteswapping in BAR writing macros

readl/writel swap to little-endian internally.

Signed-off-by: Harvey Harrison <>
Signed-off-by: David S. Miller <>
9 years agoipv6/udp: report SndbufErrors and RcvbufErrors
Eric Dumazet [Sat, 30 Oct 2010 23:17:23 +0000 (16:17 -0700)]
ipv6/udp: report SndbufErrors and RcvbufErrors

commit a18135eb9389 (Add UDP_MIB_{SND,RCV}BUFERRORS handling.)
forgot to make the necessary changes in net/ipv6/proc.c to report
additional counters in /proc/net/snmp6

Signed-off-by: Eric Dumazet <>
Signed-off-by: David S. Miller <>
9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Sat, 30 Oct 2010 18:50:37 +0000 (11:50 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git:// (22 commits)
  Ensure FMODE_NONOTIFY is not set by userspace
  make fanotify_read() restartable across signals
  fsnotify: remove alignment padding from fsnotify_mark on 64 bit builds
  fs/notify/fanotify/fanotify_user.c: fix warnings
  fanotify: Fix FAN_CLOSE comments
  fanotify: do not recalculate the mask if the ignored mask changed
  fanotify: ignore events on directories unless specifically requested
  fsnotify: rename FS_IN_ISDIR to FS_ISDIR
  fanotify: do not send events for irregular files
  fanotify: limit number of listeners per user
  fanotify: allow userspace to override max marks
  fanotify: limit the number of marks in a single fanotify group
  fanotify: allow userspace to override max queue depth
  fsnotify: implement a default maximum queue depth
  fanotify: ignore fanotify ignore marks if open writers
  fanotify: allow userspace to flush all marks
  fsnotify: call fsnotify_parent in perm events
  fsnotify: correctly handle return codes from listeners
  fanotify: use __aligned_u64 in fanotify userspace metadata
  fanotify: implement fanotify listener ordering

9 years agoMerge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of git://git.kernel...
Linus Torvalds [Sat, 30 Oct 2010 18:43:26 +0000 (11:43 -0700)]
Merge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://
  jump label: Add work around to i386 gcc asm goto bug
  x86, ftrace: Use safe noops, drop trap test
  jump_label: Fix unaligned traps on sparc.
  jump label: Make arch_jump_label_text_poke_early() optional
  jump label: Fix error with preempt disable holding mutex
  oprofile: Remove deprecated use of flush_scheduled_work()
  oprofile: Fix the hang while taking the cpu offline
  jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex
  jump label: Fix module __init section race

* 'x86-fixes-for-linus' of git://
  x86: Check irq_remapped instead of remapping_enabled in destroy_irq()

9 years agoEnsure FMODE_NONOTIFY is not set by userspace
Lino Sanfilippo [Fri, 29 Oct 2010 10:02:17 +0000 (12:02 +0200)]
Ensure FMODE_NONOTIFY is not set by userspace

    In fsnotify_open() ensure that FMODE_NONOTIFY is never set by userspace.
    Also always call fsnotify_parent and fsnotify.

Signed-off-by: Lino Sanfilippo <>
Signed-off-by: Eric Paris <>
9 years agomake fanotify_read() restartable across signals
Lino Sanfilippo [Fri, 29 Oct 2010 10:06:42 +0000 (12:06 +0200)]
make fanotify_read() restartable across signals

    In fanotify_read() return -ERESTARTSYS instead of -EINTR to
    make read() restartable across signals (BSD semantic).

Signed-off-by: Eric Paris <>
9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Sat, 30 Oct 2010 16:05:48 +0000 (09:05 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git:// (39 commits)
  Btrfs: deal with errors from updating the tree log
  Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed
  Btrfs: make SNAP_DESTROY async
  Btrfs: add SNAP_CREATE_ASYNC ioctl
  Btrfs: add START_SYNC, WAIT_SYNC ioctls
  Btrfs: async transaction commit
  Btrfs: fix deadlock in btrfs_commit_transaction
  Btrfs: fix lockdep warning on clone ioctl
  Btrfs: fix clone ioctl where range is adjacent to extent
  Btrfs: fix delalloc checks in clone ioctl
  Btrfs: drop unused variable in block_alloc_rsv
  Btrfs: cleanup warnings from gcc 4.6 (nonbugs)
  Btrfs: Fix variables set but not read (bugs found by gcc 4.6)
  Btrfs: Use ERR_CAST helpers
  Btrfs: use memdup_user helpers
  Btrfs: fix raid code for removing missing drives
  Btrfs: Switch the extent buffer rbtree into a radix tree
  Btrfs: restructure try_release_extent_buffer()
  Btrfs: use the flusher threads for delalloc throttling
  Btrfs: tune the chunk allocation to 5% of the FS as metadata

Fix up trivial conflicts in fs/btrfs/super.c and fs/fs-writeback.c, and
remove use of INIT_RCU_HEAD in fs/btrfs/extent_io.c (that init macro was
useless and removed in commit 5e8067adfdba: "rcu head remove init")

9 years agofs-writeback.c: unify some common code
Linus Torvalds [Sat, 30 Oct 2010 15:55:52 +0000 (08:55 -0700)]
fs-writeback.c: unify some common code

The btrfs merge looks like hell, because it changes fs-writeback.c, and
the crazy code has this repeated "estimate number of dirty pages"
counting that involves three different helper functions.  And it's done
in two different places.

Just unify that whole calculation as a "get_nr_dirty_pages()" helper
function, and the merge result will look half-way decent.

Signed-off-by: Linus Torvalds <>
9 years agoMerge branch 'audit.b64' of git://
Linus Torvalds [Sat, 30 Oct 2010 15:35:35 +0000 (08:35 -0700)]
Merge branch 'audit.b64' of git://git./linux/kernel/git/viro/audit-current

* 'audit.b64' of git://
  audit mmap
  audit: make link()/linkat() match "attribute change" predicate
  audit: Use rcu for task lookup protection
  audit: Do not send uninitialized data for AUDIT_TTY_GET
  audit: Call tty_audit_push_task() outside preempt disabled
  in untag_chunk() we need to do alloc_chunk() a bit earlier
  audit: make functions static
  Audit: add support to match lsm labels on user audit messages

9 years agoMerge git://
Linus Torvalds [Sat, 30 Oct 2010 15:31:35 +0000 (08:31 -0700)]
Merge git://

* git:// (82 commits)
  mtd: fix build error in m25p80.c
  mtd: Remove redundant mutex from mtd_blkdevs.c
  MTD: Fix wrong check register_blkdev return value
  Revert "mtd: cleanup Kconfig dependencies"
  mtd: cfi_cmdset_0002: make sector erase command variable
  mtd: cfi_cmdset_0002: add CFI detection for SST 38VF640x chips
  mtd: cfi_util: add support for switching SST 39VF640xB chips into QRY mode
  mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of hardcoded one
  block2mtd: dubious assignment
  P4080/mtd: Fix the freescale lbc issue with 36bit mode
  P4080/eLBC: Make Freescale elbc interrupt common to elbc devices
  mtd: phram: use KBUILD_MODNAME
  mtd: OneNAND: S5PC110: Fix double call suspend & resume function
  mtd: nand: fix MTD_MODE_RAW writes
  jffs2: use kmemdup
  mtd: sm_ftl: cosmetic, use bool when possible
  mtd: r852: remove useless pci powerup/down from suspend/resume routines
  mtd: blktrans: fix a race vs kthread_stop
  mtd: blktrans: kill BKL
  mtd: allow to unload the mtdtrans module if its block devices aren't open

Fix up trivial whitespace-introduced conflict in drivers/mtd/mtdchar.c

9 years agoMerge branch 'devel' of
Linus Torvalds [Sat, 30 Oct 2010 15:26:25 +0000 (08:26 -0700)]
Merge branch 'devel' of /home/rmk/linux-2.6-arm

* 'devel' of (215 commits)
  ARM: memblock: setup lowmem mappings using memblock
  ARM: memblock: move meminfo into find_limits directly
  ARM: memblock: convert free_highpages() to use memblock
  ARM: move freeing of highmem pages out of mem_init()
  ARM: memblock: convert memory detail printing to use memblock
  ARM: memblock: use memblock to free memory into arm_bootmem_init()
  ARM: memblock: use memblock when initializing memory allocators
  ARM: ensure membank array is always sorted
  ARM: 6466/1: implement flush_icache_all for the rest of the CPUs
  ARM: 6464/2: fix spinlock recursion in adjust_pte()
  ARM: fix memblock breakage
  ARM: 6465/1: Fix data abort accessing proc_info from __lookup_processor_type
  ARM: 6460/1: ixp2000: fix type of ixp2000_timer_interrupt
  ARM: 6449/1: Fix for compiler warning of uninitialized variable.
  ARM: 6445/1: fixup TCM memory types
  ARM: imx: Add wake functionality to GPIO
  ARM: mx5: Add gpio-keys to mx51 babbage board
  ARM: imx: Add gpio-keys to plat-mxc
  mx31_3ds: Fix spi registration
  mx31_3ds: Fix the logic for detecting the debug board

9 years agoipc: shm: fix information leak to userland
Vasiliy Kulikov [Sat, 30 Oct 2010 14:22:49 +0000 (18:22 +0400)]
ipc: shm: fix information leak to userland

The shmid_ds structure is copied to userland with shm_unused{,2,3}
fields unitialized.  It leads to leaking of contents of kernel stack

Signed-off-by: Vasiliy Kulikov <>
Acked-by: Al Viro <>
Signed-off-by: Linus Torvalds <>
9 years agofs/compat.c: fix build on MIPS/s390
wu zhangjin [Sat, 30 Oct 2010 15:19:35 +0000 (08:19 -0700)]
fs/compat.c: fix build on MIPS/s390

The definition of PAGE_CACHE_MASK in <linux/pagemap.h> is needed to use
MAX_RW_COUNT, and on x86-64 that gets done indirectly through the
architecture header includes.  But on MIPS and s390 that doesn't happen,
and we need to make sure that fs/compat.c includes pagemap.h explicitly.

Introduced in commit 435f49a518c7 ("readv/writev: do the same
MAX_RW_COUNT truncation that read/write does").

Reported-by: Sachin Sant <> (S390)
Reported-by: wu zhangjin <> (MIPS)
Signed-off-by: Linus Torvalds <>
9 years agoaudit mmap
Al Viro [Sat, 30 Oct 2010 06:54:44 +0000 (02:54 -0400)]
audit mmap

Normal syscall audit doesn't catch 5th argument of syscall.  It also
doesn't catch the contents of userland structures pointed to be
syscall argument, so for both old and new mmap(2) ABI it doesn't
record the descriptor we are mapping.  For old one it also misses

Signed-off-by: Al Viro <>
9 years agoaudit: make link()/linkat() match "attribute change" predicate
Al Viro [Wed, 11 Nov 2009 15:09:41 +0000 (10:09 -0500)]
audit: make link()/linkat() match "attribute change" predicate

Signed-off-by: Al Viro <>
9 years agoaudit: Use rcu for task lookup protection
Thomas Gleixner [Wed, 9 Dec 2009 14:19:41 +0000 (14:19 +0000)]
audit: Use rcu for task lookup protection

Protect the task lookups in audit_receive_msg() with rcu_read_lock()
instead of tasklist_lock and use lock/unlock_sighand to protect
against the exit race.

Signed-off-by: Thomas Gleixner <>
Cc: Al Viro <>
Cc: Eric Paris <>
Cc: Oleg Nesterov <>
Signed-off-by: Al Viro <>
9 years agoaudit: Do not send uninitialized data for AUDIT_TTY_GET
Thomas Gleixner [Wed, 9 Dec 2009 14:19:35 +0000 (14:19 +0000)]
audit: Do not send uninitialized data for AUDIT_TTY_GET

audit_receive_msg() sends uninitialized data for AUDIT_TTY_GET when
the task was not found.

Send reply only when task was found.

Signed-off-by: Thomas Gleixner <>
Cc: Al Viro <>
Cc: Eric Paris <>
Signed-off-by: Al Viro <>
9 years agoaudit: Call tty_audit_push_task() outside preempt disabled
Thomas Gleixner [Wed, 9 Dec 2009 14:19:31 +0000 (14:19 +0000)]
audit: Call tty_audit_push_task() outside preempt disabled

While auditing all tasklist_lock read_lock sites I stumbled over the
following call chain:


     --> buf->mutex is locked with preemption disabled.

Solve this by acquiring a reference to the task struct under
rcu_read_lock and call tty_audit_push_task outside of the preempt
disabled region.

Move all code which needs to be protected by sighand lock into
tty_audit_push_task() and use lock/unlock_sighand as we do not hold

Signed-off-by: Thomas Gleixner <>
Cc: Al Viro <>
Cc: Eric Paris <>
Cc: Oleg Nesterov <>
Signed-off-by: Al Viro <>
9 years agomtd: fix build error in m25p80.c
Andres Salomon [Sat, 30 Oct 2010 04:04:19 +0000 (21:04 -0700)]
mtd: fix build error in m25p80.c

While building an x86 distro kernel, I hit the following:

Kernel: arch/x86/boot/bzImage is ready  (#7)
ERROR: "of_mtd_parse_partitions" [drivers/mtd/devices/m25p80.ko]

of_mtd_parse_partitions is defined with MTD_OF_PARTS, and that's only
built on PPC and microblaze.  The code in question should be wrapped w/
a stricter #ifdef.

Signed-off-by: Andres Salomon <>
Acked-by: Grant Likely <>
Signed-off-by: David Woodhouse <>
9 years agomtd: Remove redundant mutex from mtd_blkdevs.c
David Woodhouse [Sat, 30 Oct 2010 11:39:21 +0000 (12:39 +0100)]
mtd: Remove redundant mutex from mtd_blkdevs.c

In commit 2a48fc0ab24241755dc93bfd4f01d68efab47f5a ('block: autoconvert
trivial BKL users to private mutex'), Arnd replaced the BKL usage with a
mutex. However, Maxim has already provided a better fix in commit
480792b7bf188c29b8d4b10fee65c3a06ec5dbf7 ('mtd: blktrans: kill BKL'),
which was simply to remove the BKL without replacing it — since he'd
already made it do all necessary locking for itself.

Signed-off-by: David Woodhouse <>
9 years agoMerge branch 'master' of git://
David Woodhouse [Sat, 30 Oct 2010 11:35:11 +0000 (12:35 +0100)]
Merge branch 'master' of git://git./linux/kernel/git/torvalds/linux-2.6.git


Merge Grant's device-tree bits so that we can apply the subsequent fixes.

Signed-off-by: David Woodhouse <>
9 years agoBtrfs: deal with errors from updating the tree log
Chris Mason [Sat, 30 Oct 2010 11:34:24 +0000 (07:34 -0400)]
Btrfs: deal with errors from updating the tree log

During unlink we remove any references to the inode from
the tree log.  It can return -ENOENT and other errors,
and this changes the unlink code to deal with it.

Signed-off-by: Chris Mason <>
9 years agoMTD: Fix wrong check register_blkdev return value
Frank Li [Tue, 26 Oct 2010 03:02:19 +0000 (11:02 +0800)]
MTD: Fix wrong check register_blkdev return value

register_blkdev return 1..255 when major = 0.

if (ret ) {
printk(KERN_WARNING "Unable to register %s block device on major %d: %d\n",
tr->name, tr->major, ret);
return ret;

Above code will return fail when register_blkdev return allocated major number.

Signed-off-by: Frank Li <>
Signed-off-by: David Woodhouse <>
9 years agosemaphore: Remove mutex emulation
Thomas Gleixner [Tue, 7 Sep 2010 14:34:01 +0000 (14:34 +0000)]
semaphore: Remove mutex emulation

Semaphores used as mutexes have been deprecated for years. Now that
all users are either converted to real semaphores or to mutexes remove
the cruft.

Signed-off-by: Thomas Gleixner <>
Cc: Peter Zijlstra <>
Cc: Christoph Hellwig <>
LKML-Reference: <>

9 years agostaging: Final semaphore cleanup
Thomas Gleixner [Sat, 30 Oct 2010 09:06:57 +0000 (11:06 +0200)]
staging: Final semaphore cleanup

Fixup the last remaining users of DECLARE_MUTEX and init_MUTEX.

Scripted conversion, resulting code is binary equivalent.

Signed-off-by: Thomas Gleixner <>
Cc: Greg Kroah-Hartman <>
LKML-Reference: <>

9 years agojbd2: Convert jbd2_slab_create_sem to mutex
Thomas Gleixner [Sat, 16 Oct 2010 20:34:39 +0000 (22:34 +0200)]
jbd2: Convert jbd2_slab_create_sem to mutex

jbd2_slab_create_sem is used as a mutex, so make it one.

[ akpm muttered: We may as well make it local to
jbd2_journal_create_slab() also. ]

Signed-off-by: Thomas Gleixner <>
Cc: Ted Ts'o <>
Cc: Andrew Morton <>
LKML-Reference: <alpine.LFD.2.00.1010162231480.2496@localhost6.localdomain6>
Signed-off-by: Thomas Gleixner <>
9 years agoMerge branch 'tip/perf/jump-label-2' of git://
Ingo Molnar [Sat, 30 Oct 2010 08:43:08 +0000 (10:43 +0200)]
Merge branch 'tip/perf/jump-label-2' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent

9 years agox86: Check irq_remapped instead of remapping_enabled in destroy_irq()
Yinghai Lu [Sat, 30 Oct 2010 08:19:29 +0000 (01:19 -0700)]
x86: Check irq_remapped instead of remapping_enabled in destroy_irq()

Russ Anderson reported:
| There is a regression that is causing a NULL pointer dereference
| in free_irte when shutting down xpc. git bisect narrowed it down
| to git commit d585d06(intr_remap: Simplify the code further), which
| changed free_irte(). Reverse applying the patch fixes the problem.

We need to use irq_remapped() for each irq instead of checking only
intr_remapping_enabled as there might be non remapped irqs even when
remapping is enabled.

[ tglx: use cfg instead of retrieving it again. Massaged changelog ]

Reported-bisected-and-tested-by: Russ Anderson <>
Signed-off-by: Yinghai Lu <>
Cc: Suresh Siddha <>
LKML-Reference: <>
Signed-off-by: Thomas Gleixner <>
9 years agohpfs: Convert sbi->hpfs_creation_de to mutex
Thomas Gleixner [Tue, 7 Sep 2010 14:32:56 +0000 (14:32 +0000)]
hpfs: Convert sbi->hpfs_creation_de to mutex

sbi->hpfs_creation_de is used as mutex so make it a mutex.

Signed-off-by: Thomas Gleixner <>
Acked-by: Christoph Hellwig <>
Cc: Peter Zijlstra <>
Cc: Al Viro <>
LKML-Reference: <>

9 years agoin untag_chunk() we need to do alloc_chunk() a bit earlier
Al Viro [Sat, 30 Oct 2010 06:18:32 +0000 (02:18 -0400)]
in untag_chunk() we need to do alloc_chunk() a bit earlier

... while we are not holding spinlocks.

Signed-off-by: Al Viro <>
9 years agoaudit: make functions static
Stephen Hemminger [Thu, 21 Oct 2010 00:23:50 +0000 (17:23 -0700)]
audit: make functions static

I was doing some namespace checks and found some simple stuff in
audit that could be cleaned up. Make some functions static, and
put const on make_reply payload arg.

Signed-off-by: Stephen Hemminger <>
Signed-off-by: Al Viro <>
9 years agoAudit: add support to match lsm labels on user audit messages
Miloslav Trmac [Thu, 16 Sep 2010 22:14:11 +0000 (18:14 -0400)]
Audit: add support to match lsm labels on user audit messages

Add support for matching by security label (e.g. SELinux context) of
the sender of an user-space audit record.

The audit filter code already allows user space to configure such
filters, but they were ignored during evaluation.  This patch implements
evaluation of these filters.

For example, after application of this patch, PAM authentication logs
caused by cron can be disabled using
auditctl -a user,never -F subj_type=crond_t

Signed-off-by: Miloslav Trmac <>
Acked-by: Eric Paris <>
Signed-off-by: Al Viro <>
9 years agoMerge branches 'x86-fixes-for-linus' and 'x86-uv-for-linus' of git://
Linus Torvalds [Sat, 30 Oct 2010 01:58:00 +0000 (18:58 -0700)]
Merge branches 'x86-fixes-for-linus' and 'x86-uv-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86, alternative: Call stop_machine_text_poke() on all cpus
  x86-32: Restore irq stacks NUMA-aware allocations
  x86, memblock: Fix early_node_mem with big reserved region.

* 'x86-uv-for-linus' of git://
  x86, uv: More Westmere support on SGI UV
  x86, uv: Enable Westmere support on SGI UV

9 years agoMerge branches 'msm-fixes' and 'msm-video' of git://
Linus Torvalds [Sat, 30 Oct 2010 01:57:04 +0000 (18:57 -0700)]
Merge branches 'msm-fixes' and 'msm-video' of git://

* 'msm-fixes' of git://
  msm: Kconfig: drop unused config options
  msm: fix compile failure when no debug uart is selected
  msm: fix debug-macro.S build failure
  msm: timer: Decrease shift on timer clocksource
  arm: mach-msm: fix error handling in msm_iommu_probe()
  msm: fix Kconfig target board selection
  msm: fix compile failure on struct membank node member

* 'msm-video' of git://
  drivers/video/msm/mddi.c: Remove multiple KERN_<level> uses
  drivers: msm: video: add dev_set_name call
  drivers: video: msm: fix hang on disable_irq

9 years agoBtrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed
Sage Weil [Fri, 29 Oct 2010 19:46:43 +0000 (15:46 -0400)]
Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed

Add a mount option user_subvol_rm_allowed that allows users to delete a
(potentially non-empty!) subvol when they would otherwise we allowed to do
an rmdir(2).  We duplicate the may_delete() checks from the core VFS code
to implement identical security checks (minus the directory size check).
We additionally require that the user has write+exec permission on the
subvol root inode.

Signed-off-by: Sage Weil <>
Signed-off-by: Chris Mason <>
9 years agoBtrfs: make SNAP_DESTROY async
Sage Weil [Fri, 29 Oct 2010 19:41:32 +0000 (15:41 -0400)]
Btrfs: make SNAP_DESTROY async

There is no reason to force an immediate commit when deleting a snapshot.
Users have some expectation that space from a deleted snapshot be freed
immediately, but even if we do commit the reclaim is a background process.

If users _do_ want the deletion to be durable, they can call 'sync'.

Signed-off-by: Sage Weil <>
Signed-off-by: Chris Mason <>
9 years agoBtrfs: add SNAP_CREATE_ASYNC ioctl
Sage Weil [Fri, 29 Oct 2010 19:41:32 +0000 (15:41 -0400)]
Btrfs: add SNAP_CREATE_ASYNC ioctl

Create a snap without waiting for it to commit to disk.  The ioctl is
ordered such that subsequent operations will not be contained by the
created snapshot, and the commit is initiated, but the ioctl does not
wait for the snapshot to commit to disk.

We return the specific transid to userspace so that an application can wait
for this specific snapshot creation to commit via the WAIT_SYNC ioctl.

Signed-off-by: Sage Weil <>
Signed-off-by: Chris Mason <>
9 years agoMerge branch 'for-2637/s3c24xx-all' of git://
Linus Torvalds [Fri, 29 Oct 2010 23:49:34 +0000 (16:49 -0700)]
Merge branch 'for-2637/s3c24xx-all' of git://

* 'for-2637/s3c24xx-all' of git://
  ARM: h1940: add UDA1380 to i2c devices list
  ARM: h1940: Fix backlight and LCD power functions
  ARM: S3C2440: fix boot failure introduced by recent changes in gpiolib
  ARM: S3C2440: various fixes in Kconfig file
  ARM: rx1950: Add UDA1380 to i2c devices list
  ARM: rx1950: Add LEDs support
  ARM: rx1950: Add battery device
  ARM: h1940: Implement mmc_power function
  ARM: h1940: Use gpiolib for latch access

9 years agoARM: Merge for-2637/s3c24xx/misc
Ben Dooks [Fri, 29 Oct 2010 23:46:55 +0000 (00:46 +0100)]
ARM: Merge for-2637/s3c24xx/misc

9 years agoARM: Merge for-2637/s3c24xx/h1940
Ben Dooks [Fri, 29 Oct 2010 23:46:49 +0000 (00:46 +0100)]
ARM: Merge for-2637/s3c24xx/h1940

9 years agoARM: Merge for-2637/s3c24xx/rx1950
Ben Dooks [Fri, 29 Oct 2010 23:46:34 +0000 (00:46 +0100)]
ARM: Merge for-2637/s3c24xx/rx1950

9 years agoARM: h1940: add UDA1380 to i2c devices list
Vasily Khoruzhick [Mon, 27 Sep 2010 06:32:49 +0000 (09:32 +0300)]
ARM: h1940: add UDA1380 to i2c devices list

Register UDA1380 codec during H1940 machine init

Signed-off-by: Vasily Khoruzhick <>
Signed-off-by: Ben Dooks <>
9 years agoARM: h1940: Fix backlight and LCD power functions
Vasily Khoruzhick [Mon, 27 Sep 2010 06:28:00 +0000 (09:28 +0300)]
ARM: h1940: Fix backlight and LCD power functions

Current implementation of LCD and backlight power control functions
is not complete, as result PDA consumes power in suspend.
Fix this issue by managing state of some latch bits, just like
WinMobile does.

Signed-off-by: Vasily Khoruzhick <>
Signed-off-by: Ben Dooks <>
9 years agox86, alternative: Call stop_machine_text_poke() on all cpus
Jason Baron [Thu, 28 Oct 2010 15:20:27 +0000 (11:20 -0400)]
x86, alternative: Call stop_machine_text_poke() on all cpus

Currently, text_poke_smp() passes a NULL as the third argument to
__stop_machine(), which will only run stop_machine_text_poke()
on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
is intended to be run on all cpus.

I actually didn't notice any problems with stop_machine_text_poke()
only being called on 1 cpu, but found this via code inspection.

Signed-off-by: Jason Baron <>
LKML-Reference: <>
Acked-by: Mathieu Desnoyers <>
Acked-by: Masami Hiramatsu <>
Signed-off-by: H. Peter Anvin <>
9 years agoARM: S3C2440: fix boot failure introduced by recent changes in gpiolib
Abdoulaye Walsimou Gaye [Sat, 16 Oct 2010 11:55:52 +0000 (13:55 +0200)]
ARM: S3C2440: fix boot failure introduced by recent changes in gpiolib

Recent changes in s3c gpio break mini2440 board and may be others.
The problem is that mach-mini2440.c: mini2440_init()
(where we call s3c_gpio_setpull()) is called before s3c2440.c: s3c2440_init()
(where we initialize s3c24xx_gpiocfg_default.set_pull function pointer).
This causes dereferencing of NULL pointer at boot time and a kernel panic.

Signed-off-by: Abdoulaye Walsimou Gaye <>
Signed-off-by: Ben Dooks <>
9 years agoARM: S3C2440: various fixes in Kconfig file
Abdoulaye Walsimou Gaye [Sat, 16 Oct 2010 11:55:51 +0000 (13:55 +0200)]
ARM: S3C2440: various fixes in Kconfig file

* kconfig symbols defined in arch/arm/mach-s3c2440/Kconfig are only available
  when ARCH_S3C2410 is selected, so no need to make some of them depend
  on ARCH_S3C2410.
* fix CPU_S3C24405B typo in "config S3C2440_DMA".
* mini2440: remove unconditionally select of SND_S3C24XX_SOC_S3C24XX_UDA134X.
Those fixes avoid the following warnings at make time:

scripts/kconfig/qconf arch/arm/Kconfig
warning: (MACH_MINI2440 && ARCH_S3C2410) selects SND_S3C24XX_SOC_S3C24XX_UDA134X
which has unmet direct dependencies (SND_S3C24XX_SOC && ARCH_S3C2410)
warning: (CPU_S3C2440 && ARCH_S3C2410 && S3C2410_DMA) selects S3C2440_DMA which
has unmet direct dependencies (ARCH_S3C2410 && CPU_S3C24405B)
warning: (CPU_S3C2440 && ARCH_S3C2410 || CPU_S3C2442 && ARCH_S3C2410)
selects CPU_S3C244X which has unmet direct dependencies (!ARCH_S3C2410)

Signed-off-by: Abdoulaye Walsimou Gaye <>
Signed-off-by: Ben Dooks <>
9 years agoMerge branch 'for-2637/i2c-all' of git://
Linus Torvalds [Fri, 29 Oct 2010 23:15:57 +0000 (16:15 -0700)]
Merge branch 'for-2637/i2c-all' of git://

* 'for-2637/i2c-all' of git://
  i2c-intel-mid: Driver depends on PCI
  i2c-intel-mid: support for Moorestown and Medfield platform
  i2c-nomadik: fixup bus delays
  i2c-nomadik: support smbus emulation
  i2c-nomadik: dynamic clocking
  i2c-nomadik: documentation fixes
  i2c-s3c2410: Enable i2c clock only when doing some transfert

9 years agomsm: Kconfig: drop unused config options
Daniel Walker [Wed, 27 Oct 2010 20:10:34 +0000 (13:10 -0700)]
msm: Kconfig: drop unused config options

These two config options don't exist, and aren't ever going to.
So I simply delete them.

Signed-off-by: Daniel Walker <>
9 years agomsm: fix compile failure when no debug uart is selected
Daniel Walker [Wed, 27 Oct 2010 20:04:58 +0000 (13:04 -0700)]
msm: fix compile failure when no debug uart is selected

If the board has a debug uart the user is given a choice of which
uart to use. The user can also select NONE, which means not to use one.
In most of our header files when NONE is selected nothing is defined
for MSM_DEBUG_UART_PHYS or MSM_DEBUG_UART_BASE. This causes a compile
failure in debug-macro.S which expect something to be defined there.

Example of the failure,

arch/arm/kernel/built-in.o: In function `hexbuf':
linux-2.6/arch/arm/kernel/debug.S:186: undefined reference to `MSM_DEBUG_UART_PHYS'
linux-2.6/arch/arm/kernel/debug.S:186: undefined reference to `MSM_DEBUG_UART_BASE'

This fixes the compile failure by adding an ifdef to debug-macro.S
that removes all the debug uart code in the case of NONE.

Signed-off-by: Daniel Walker <>