]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoMerge remote-tracking branch 'md/for-next'
Mark Brown [Thu, 17 Oct 2013 18:21:34 +0000 (19:21 +0100)]
Merge remote-tracking branch 'md/for-next'

11 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Mark Brown [Thu, 17 Oct 2013 18:17:56 +0000 (19:17 +0100)]
Merge remote-tracking branch 'kgdb/kgdb-next'

11 years agoMerge remote-tracking branch 'mmc/mmc-next'
Mark Brown [Thu, 17 Oct 2013 18:15:46 +0000 (19:15 +0100)]
Merge remote-tracking branch 'mmc/mmc-next'

11 years agoMerge remote-tracking branch 'block/for-next'
Mark Brown [Thu, 17 Oct 2013 18:07:57 +0000 (19:07 +0100)]
Merge remote-tracking branch 'block/for-next'

11 years agoMerge remote-tracking branch 'cgroup/for-next'
Mark Brown [Thu, 17 Oct 2013 17:59:25 +0000 (18:59 +0100)]
Merge remote-tracking branch 'cgroup/for-next'

Conflicts:
mm/memcontrol.c

11 years agoMerge remote-tracking branch 'input/next'
Mark Brown [Thu, 17 Oct 2013 14:37:01 +0000 (15:37 +0100)]
Merge remote-tracking branch 'input/next'

11 years agoMerge remote-tracking branch 'virtio/virtio-next'
Mark Brown [Thu, 17 Oct 2013 14:34:54 +0000 (15:34 +0100)]
Merge remote-tracking branch 'virtio/virtio-next'

11 years agoMerge remote-tracking branch 'modules/modules-next'
Mark Brown [Thu, 17 Oct 2013 14:23:20 +0000 (15:23 +0100)]
Merge remote-tracking branch 'modules/modules-next'

11 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Mark Brown [Thu, 17 Oct 2013 14:21:01 +0000 (15:21 +0100)]
Merge remote-tracking branch 'sound-asoc/for-next'

11 years agoMerge remote-tracking branch 'sound/for-next'
Mark Brown [Thu, 17 Oct 2013 14:18:52 +0000 (15:18 +0100)]
Merge remote-tracking branch 'sound/for-next'

11 years agoMerge remote-tracking branch 'drm-tegra/drm/for-next'
Mark Brown [Thu, 17 Oct 2013 13:55:09 +0000 (14:55 +0100)]
Merge remote-tracking branch 'drm-tegra/drm/for-next'

Conflicts:
drivers/gpu/drm/tegra/Kconfig
drivers/gpu/drm/tegra/drm.c

11 years agoMerge remote-tracking branch 'drm-intel/for-linux-next'
Mark Brown [Thu, 17 Oct 2013 13:35:30 +0000 (14:35 +0100)]
Merge remote-tracking branch 'drm-intel/for-linux-next'

11 years agodrm/i915: Resolve interaction with drm-fixes tree
Mark Brown [Thu, 3 Oct 2013 17:10:55 +0000 (18:10 +0100)]
drm/i915: Resolve interaction with drm-fixes tree

Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agoMerge remote-tracking branch 'drm/drm-next'
Mark Brown [Thu, 17 Oct 2013 13:31:33 +0000 (14:31 +0100)]
Merge remote-tracking branch 'drm/drm-next'

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h

11 years agoMerge remote-tracking branch 'crypto/master'
Mark Brown [Thu, 17 Oct 2013 13:29:04 +0000 (14:29 +0100)]
Merge remote-tracking branch 'crypto/master'

11 years agoMerge remote-tracking branch 'l2-mtd/master'
Mark Brown [Thu, 17 Oct 2013 13:26:47 +0000 (14:26 +0100)]
Merge remote-tracking branch 'l2-mtd/master'

11 years agoMerge remote-tracking branch 'bluetooth/master'
Mark Brown [Thu, 17 Oct 2013 13:23:09 +0000 (14:23 +0100)]
Merge remote-tracking branch 'bluetooth/master'

11 years agoMerge remote-tracking branch 'wireless-next/master'
Mark Brown [Thu, 17 Oct 2013 13:19:57 +0000 (14:19 +0100)]
Merge remote-tracking branch 'wireless-next/master'

11 years agoMerge remote-tracking branch 'ipsec-next/master'
Mark Brown [Thu, 17 Oct 2013 13:17:40 +0000 (14:17 +0100)]
Merge remote-tracking branch 'ipsec-next/master'

11 years agoMerge remote-tracking branch 'net-next/master'
Mark Brown [Thu, 17 Oct 2013 13:08:44 +0000 (14:08 +0100)]
Merge remote-tracking branch 'net-next/master'

Conflicts:
arch/h8300/include/uapi/asm/socket.h

11 years agoMerge remote-tracking branch 'slave-dma/next'
Mark Brown [Thu, 17 Oct 2013 11:54:51 +0000 (12:54 +0100)]
Merge remote-tracking branch 'slave-dma/next'

11 years agoMerge remote-tracking branch 'dlm/next'
Mark Brown [Thu, 17 Oct 2013 11:52:02 +0000 (12:52 +0100)]
Merge remote-tracking branch 'dlm/next'

11 years agoMerge remote-tracking branch 'ubi/linux-next'
Mark Brown [Thu, 17 Oct 2013 11:49:57 +0000 (12:49 +0100)]
Merge remote-tracking branch 'ubi/linux-next'

11 years agoMerge remote-tracking branch 'thermal/next'
Mark Brown [Thu, 17 Oct 2013 11:47:06 +0000 (12:47 +0100)]
Merge remote-tracking branch 'thermal/next'

11 years agoMerge remote-tracking branch 'idle/next'
Mark Brown [Thu, 17 Oct 2013 11:29:39 +0000 (12:29 +0100)]
Merge remote-tracking branch 'idle/next'

11 years agoMerge remote-tracking branch 'pm/linux-next'
Mark Brown [Thu, 17 Oct 2013 11:13:58 +0000 (12:13 +0100)]
Merge remote-tracking branch 'pm/linux-next'

Conflicts:
drivers/i2c/i2c-core.c

11 years agoMerge remote-tracking branch 'libata/for-next'
Mark Brown [Thu, 17 Oct 2013 11:10:49 +0000 (12:10 +0100)]
Merge remote-tracking branch 'libata/for-next'

11 years agoMerge remote-tracking branch 'kbuild/for-next'
Mark Brown [Thu, 17 Oct 2013 11:07:55 +0000 (12:07 +0100)]
Merge remote-tracking branch 'kbuild/for-next'

11 years agoMerge remote-tracking branch 'v4l-dvb/master'
Mark Brown [Thu, 17 Oct 2013 11:05:38 +0000 (12:05 +0100)]
Merge remote-tracking branch 'v4l-dvb/master'

11 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Mark Brown [Thu, 17 Oct 2013 11:03:21 +0000 (12:03 +0100)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

11 years agoMerge remote-tracking branch 'i2c/i2c/for-next'
Mark Brown [Thu, 17 Oct 2013 10:58:57 +0000 (11:58 +0100)]
Merge remote-tracking branch 'i2c/i2c/for-next'

11 years agoMerge remote-tracking branch 'hid/for-next'
Mark Brown [Thu, 17 Oct 2013 10:56:45 +0000 (11:56 +0100)]
Merge remote-tracking branch 'hid/for-next'

11 years agoMerge remote-tracking branch 'pci/next'
Mark Brown [Thu, 17 Oct 2013 10:50:18 +0000 (11:50 +0100)]
Merge remote-tracking branch 'pci/next'

11 years agoMerge remote-tracking branch 'vfs/for-next'
Mark Brown [Thu, 17 Oct 2013 10:35:36 +0000 (11:35 +0100)]
Merge remote-tracking branch 'vfs/for-next'

Conflicts:
fs/nfs/direct.c
fs/nfs/file.c

11 years agoMerge remote-tracking branch 'xfs/for-next'
Mark Brown [Thu, 17 Oct 2013 10:28:59 +0000 (11:28 +0100)]
Merge remote-tracking branch 'xfs/for-next'

11 years agoMerge remote-tracking branch 'nfsd/nfsd-next'
Mark Brown [Thu, 17 Oct 2013 10:23:47 +0000 (11:23 +0100)]
Merge remote-tracking branch 'nfsd/nfsd-next'

11 years agoMerge remote-tracking branch 'nfs/linux-next'
Mark Brown [Thu, 17 Oct 2013 10:21:26 +0000 (11:21 +0100)]
Merge remote-tracking branch 'nfs/linux-next'

11 years agoMerge remote-tracking branch 'logfs/master'
Mark Brown [Thu, 17 Oct 2013 10:19:18 +0000 (11:19 +0100)]
Merge remote-tracking branch 'logfs/master'

11 years agoMerge remote-tracking branch 'jfs/jfs-next'
Mark Brown [Thu, 17 Oct 2013 10:17:07 +0000 (11:17 +0100)]
Merge remote-tracking branch 'jfs/jfs-next'

11 years agoMerge remote-tracking branch 'gfs2/master'
Mark Brown [Thu, 17 Oct 2013 10:14:56 +0000 (11:14 +0100)]
Merge remote-tracking branch 'gfs2/master'

11 years agoMerge remote-tracking branch 'fuse/for-next'
Mark Brown [Thu, 17 Oct 2013 09:59:14 +0000 (10:59 +0100)]
Merge remote-tracking branch 'fuse/for-next'

11 years agoMerge remote-tracking branch 'fscache/fscache'
Mark Brown [Thu, 17 Oct 2013 09:45:01 +0000 (10:45 +0100)]
Merge remote-tracking branch 'fscache/fscache'

11 years agoMerge remote-tracking branch 'f2fs/dev'
Mark Brown [Thu, 17 Oct 2013 09:42:56 +0000 (10:42 +0100)]
Merge remote-tracking branch 'f2fs/dev'

11 years agoMerge remote-tracking branch 'ecryptfs/next'
Mark Brown [Thu, 17 Oct 2013 09:39:22 +0000 (10:39 +0100)]
Merge remote-tracking branch 'ecryptfs/next'

11 years agoMerge remote-tracking branch 'cifs/for-next'
Mark Brown [Thu, 17 Oct 2013 09:34:52 +0000 (10:34 +0100)]
Merge remote-tracking branch 'cifs/for-next'

11 years agoceph: Fix up for iov_iter changes
Mark Brown [Thu, 3 Oct 2013 12:05:20 +0000 (13:05 +0100)]
ceph: Fix up for iov_iter changes

Extend an earlier fixup by Stephen Rothwell.

Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agoMerge remote-tracking branch 'ceph/master'
Mark Brown [Thu, 17 Oct 2013 09:19:24 +0000 (10:19 +0100)]
Merge remote-tracking branch 'ceph/master'

11 years agoMerge remote-tracking branch 'aio-direct/for-next'
Mark Brown [Thu, 17 Oct 2013 09:04:23 +0000 (10:04 +0100)]
Merge remote-tracking branch 'aio-direct/for-next'

11 years agoMerge remote-tracking branch 'sh/sh-latest'
Mark Brown [Thu, 17 Oct 2013 08:59:20 +0000 (09:59 +0100)]
Merge remote-tracking branch 'sh/sh-latest'

Conflicts:
arch/sh/kernel/cpu/sh2a/Makefile
drivers/tty/serial/sh-sci.c
include/linux/serial_sci.h

11 years agoMerge remote-tracking branch 's390/features'
Mark Brown [Thu, 17 Oct 2013 07:45:28 +0000 (08:45 +0100)]
Merge remote-tracking branch 's390/features'

11 years agoMerge remote-tracking branch 'mpc5xxx/next'
Mark Brown [Thu, 17 Oct 2013 07:42:41 +0000 (08:42 +0100)]
Merge remote-tracking branch 'mpc5xxx/next'

11 years agoMerge remote-tracking branch 'powerpc/next'
Mark Brown [Thu, 17 Oct 2013 07:27:20 +0000 (08:27 +0100)]
Merge remote-tracking branch 'powerpc/next'

11 years agoMerge remote-tracking branch 'parisc-hd/for-next'
Mark Brown [Thu, 17 Oct 2013 07:25:17 +0000 (08:25 +0100)]
Merge remote-tracking branch 'parisc-hd/for-next'

11 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Mark Brown [Thu, 17 Oct 2013 07:21:46 +0000 (08:21 +0100)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

11 years agoMerge remote-tracking branch 'm68k/for-next'
Mark Brown [Thu, 17 Oct 2013 07:17:32 +0000 (08:17 +0100)]
Merge remote-tracking branch 'm68k/for-next'

11 years agoMerge remote-tracking branch 'ia64/next'
Mark Brown [Thu, 17 Oct 2013 07:15:30 +0000 (08:15 +0100)]
Merge remote-tracking branch 'ia64/next'

11 years agoMerge remote-tracking branch 'h8300-remove/h8300-remove'
Mark Brown [Thu, 17 Oct 2013 07:03:03 +0000 (08:03 +0100)]
Merge remote-tracking branch 'h8300-remove/h8300-remove'

11 years agoMerge remote-tracking branch 'c6x/for-linux-next'
Mark Brown [Thu, 17 Oct 2013 07:00:17 +0000 (08:00 +0100)]
Merge remote-tracking branch 'c6x/for-linux-next'

11 years agoMerge remote-tracking branch 'arm-perf/for-next/perf'
Mark Brown [Thu, 17 Oct 2013 06:56:47 +0000 (07:56 +0100)]
Merge remote-tracking branch 'arm-perf/for-next/perf'

11 years agoMerge remote-tracking branch 'arm/for-next'
Mark Brown [Thu, 17 Oct 2013 06:46:00 +0000 (07:46 +0100)]
Merge remote-tracking branch 'arm/for-next'

11 years agoMerge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'
Mark Brown [Thu, 17 Oct 2013 06:42:23 +0000 (07:42 +0100)]
Merge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'

11 years agoMerge remote-tracking branch 'input-current/for-linus'
Mark Brown [Thu, 17 Oct 2013 06:33:03 +0000 (07:33 +0100)]
Merge remote-tracking branch 'input-current/for-linus'

11 years agoMerge remote-tracking branch 'char-misc.current/char-misc-linus'
Mark Brown [Thu, 17 Oct 2013 06:31:00 +0000 (07:31 +0100)]
Merge remote-tracking branch 'char-misc.current/char-misc-linus'

11 years agoMerge remote-tracking branch 'usb.current/usb-linus'
Mark Brown [Thu, 17 Oct 2013 06:27:32 +0000 (07:27 +0100)]
Merge remote-tracking branch 'usb.current/usb-linus'

11 years agoMerge remote-tracking branch 'tty.current/tty-linus'
Mark Brown [Thu, 17 Oct 2013 06:24:47 +0000 (07:24 +0100)]
Merge remote-tracking branch 'tty.current/tty-linus'

11 years agoMerge remote-tracking branch 'driver-core.current/driver-core-linus'
Mark Brown [Thu, 17 Oct 2013 06:22:01 +0000 (07:22 +0100)]
Merge remote-tracking branch 'driver-core.current/driver-core-linus'

11 years agoMerge remote-tracking branch 'wireless/master'
Mark Brown [Thu, 17 Oct 2013 06:19:06 +0000 (07:19 +0100)]
Merge remote-tracking branch 'wireless/master'

11 years agoMerge remote-tracking branch 'sound-current/for-linus'
Mark Brown [Thu, 17 Oct 2013 06:15:16 +0000 (07:15 +0100)]
Merge remote-tracking branch 'sound-current/for-linus'

11 years agoMerge remote-tracking branch 'net/master'
Mark Brown [Thu, 17 Oct 2013 06:04:54 +0000 (07:04 +0100)]
Merge remote-tracking branch 'net/master'

11 years agoMerge branch 'akpm' (fixes from Andrew Morton)
Linus Torvalds [Thu, 17 Oct 2013 04:36:03 +0000 (21:36 -0700)]
Merge branch 'akpm' (fixes from Andrew Morton)

Merge misc fixes from Andrew Morton.

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
  mm: revert mremap pud_free anti-fix
  mm: fix BUG in __split_huge_page_pmd
  swap: fix set_blocksize race during swapon/swapoff
  procfs: call default get_unmapped_area on MMU-present architectures
  procfs: fix unintended truncation of returned mapped address
  writeback: fix negative bdi max pause
  percpu_refcount: export symbols
  fs: buffer: move allocation failure loop into the allocator
  mm: memcg: handle non-error OOM situations more gracefully
  tools/testing/selftests: fix uninitialized variable
  block/partitions/efi.c: treat size mismatch as a warning, not an error
  mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
  mm/zswap: bugfix: memory leak when re-swapon
  mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
  mm: migration: do not lose soft dirty bit if page is in migration state
  gcov: MAINTAINERS: Add an entry for gcov
  mm/hugetlb.c: correct missing private flag clearing
  mm/vmscan.c: don't forget to free shrinker->nr_deferred
  ipc/sem.c: synchronize semop and semctl with IPC_RMID
  ipc: update locking scheme comments
  ...

11 years agomm: revert mremap pud_free anti-fix
Hugh Dickins [Wed, 16 Oct 2013 20:47:09 +0000 (13:47 -0700)]
mm: revert mremap pud_free anti-fix

Revert commit 1ecfd533f4c5 ("mm/mremap.c: call pud_free() after fail
calling pmd_alloc()").

The original code was correct: pud_alloc(), pmd_alloc(), pte_alloc_map()
ensure that the pud, pmd, pt is already allocated, and seldom do they
need to allocate; on failure, upper levels are freed if appropriate by
the subsequent do_munmap().  Whereas commit 1ecfd533f4c5 did an
unconditional pud_free() of a most-likely still-in-use pud: saved only
by the near-impossiblity of pmd_alloc() failing.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: fix BUG in __split_huge_page_pmd
Hugh Dickins [Wed, 16 Oct 2013 20:47:08 +0000 (13:47 -0700)]
mm: fix BUG in __split_huge_page_pmd

Occasionally we hit the BUG_ON(pmd_trans_huge(*pmd)) at the end of
__split_huge_page_pmd(): seen when doing madvise(,,MADV_DONTNEED).

It's invalid: we don't always have down_write of mmap_sem there: a racing
do_huge_pmd_wp_page() might have copied-on-write to another huge page
before our split_huge_page() got the anon_vma lock.

Forget the BUG_ON, just go back and try again if this happens.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: David Rientjes <rientjes@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoswap: fix set_blocksize race during swapon/swapoff
Krzysztof Kozlowski [Wed, 16 Oct 2013 20:47:06 +0000 (13:47 -0700)]
swap: fix set_blocksize race during swapon/swapoff

Fix race between swapoff and swapon.  Swapoff used old_block_size from
swap_info outside of swapon_mutex so it could be overwritten by
concurrent swapon.

The race has visible effect only if more than one swap block device
exists with different block sizes (e.g.  /dev/sda1 with block size 4096
and /dev/sdb1 with 512).  In such case it leads to setting the blocksize
of swapped off device with wrong blocksize.

The bug can be triggered with multiple concurrent swapoff and swapon:
0. Swap for some device is on.
1. swapoff:
First the swapoff is called on this device and "struct swap_info_struct
*p" is assigned. This is done under swap_lock however this lock is
released for the call try_to_unuse().

2. swapon:
After the assignment above (and before acquiring swapon_mutex &
swap_lock by swapoff) the swapon is called on the same device.
The p->old_block_size is assigned to the value of block_size the device.
This block size should be the same as previous but sometimes it is not.
The swapon ends successfully.

3. swapoff:
Swapoff resumes, grabs the locks and mutex and continues to disable this
swap device. Now it sets the block size to value taken from swap_info
which was overwritten by swapon in 2.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reported-by: Weijie Yang <weijie.yang.kh@gmail.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Shaohua Li <shli@fusionio.com>
Cc: Minchan Kim <minchan@kernel.org>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoprocfs: call default get_unmapped_area on MMU-present architectures
HATAYAMA Daisuke [Wed, 16 Oct 2013 20:47:05 +0000 (13:47 -0700)]
procfs: call default get_unmapped_area on MMU-present architectures

Commit c4fe24485729 ("sparc: fix PCI device proc file mmap(2)") added
proc_reg_get_unmapped_area in proc_reg_file_ops and
proc_reg_file_ops_no_compat, by which now mmap always returns EIO if
get_unmapped_area method is not defined for the target procfs file,
which causes regression of mmap on /proc/vmcore.

To address this issue, like get_unmapped_area(), call default
current->mm->get_unmapped_area on MMU-present architectures if
pde->proc_fops->get_unmapped_area, i.e.  the one in actual file
operation in the procfs file, is not defined.

Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Tested-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoprocfs: fix unintended truncation of returned mapped address
HATAYAMA Daisuke [Wed, 16 Oct 2013 20:47:04 +0000 (13:47 -0700)]
procfs: fix unintended truncation of returned mapped address

Currently, proc_reg_get_unmapped_area truncates upper 32-bit of the
mapped virtual address returned from get_unmapped_area method in
pde->proc_fops due to the variable rv of signed integer on x86_64.  This
is too small to have vitual address of unsigned long on x86_64 since on
x86_64, signed integer is of 4 bytes while unsigned long is of 8 bytes.
To fix this issue, use unsigned long instead.

Fixes a regression added in commit c4fe24485729 ("sparc: fix PCI device
proc file mmap(2)").

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Tested-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agowriteback: fix negative bdi max pause
Fengguang Wu [Wed, 16 Oct 2013 20:47:03 +0000 (13:47 -0700)]
writeback: fix negative bdi max pause

Toralf runs trinity on UML/i386.  After some time it hangs and the last
message line is

BUG: soft lockup - CPU#0 stuck for 22s! [trinity-child0:1521]

It's found that pages_dirtied becomes very large.  More than 1000000000
pages in this case:

period = HZ * pages_dirtied / task_ratelimit;
BUG_ON(pages_dirtied > 2000000000);
BUG_ON(pages_dirtied > 1000000000);      <---------

UML debug printf shows that we got negative pause here:

ick: pause : -984
ick: pages_dirtied : 0
ick: task_ratelimit: 0

 pause:
+       if (pause < 0)  {
+               extern int printf(char *, ...);
+               printf("ick : pause : %li\n", pause);
+               printf("ick: pages_dirtied : %lu\n", pages_dirtied);
+               printf("ick: task_ratelimit: %lu\n", task_ratelimit);
+               BUG_ON(1);
+       }
        trace_balance_dirty_pages(bdi,

Since pause is bounded by [min_pause, max_pause] where min_pause is also
bounded by max_pause.  It's suspected and demonstrated that the
max_pause calculation goes wrong:

ick: pause : -717
ick: min_pause : -177
ick: max_pause : -717
ick: pages_dirtied : 14
ick: task_ratelimit: 0

The problem lies in the two "long = unsigned long" assignments in
bdi_max_pause() which might go negative if the highest bit is 1, and the
min_t(long, ...) check failed to protect it falling under 0.  Fix all of
them by using "unsigned long" throughout the function.

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Tested-by: Toralf Förster <toralf.foerster@gmx.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Richard Weinberger <richard@nod.at>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agopercpu_refcount: export symbols
Matias Bjorling [Wed, 16 Oct 2013 20:47:01 +0000 (13:47 -0700)]
percpu_refcount: export symbols

Export the interface to be used within modules.

Signed-off-by: Matias Bjorling <m@bjorling.me>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agofs: buffer: move allocation failure loop into the allocator
Johannes Weiner [Wed, 16 Oct 2013 20:47:00 +0000 (13:47 -0700)]
fs: buffer: move allocation failure loop into the allocator

Buffer allocation has a very crude indefinite loop around waking the
flusher threads and performing global NOFS direct reclaim because it can
not handle allocation failures.

The most immediate problem with this is that the allocation may fail due
to a memory cgroup limit, where flushers + direct reclaim might not make
any progress towards resolving the situation at all.  Because unlike the
global case, a memory cgroup may not have any cache at all, only
anonymous pages but no swap.  This situation will lead to a reclaim
livelock with insane IO from waking the flushers and thrashing unrelated
filesystem cache in a tight loop.

Use __GFP_NOFAIL allocations for buffers for now.  This makes sure that
any looping happens in the page allocator, which knows how to
orchestrate kswapd, direct reclaim, and the flushers sensibly.  It also
allows memory cgroups to detect allocations that can't handle failure
and will allow them to ultimately bypass the limit if reclaim can not
make progress.

Reported-by: azurIt <azurit@pobox.sk>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: memcg: handle non-error OOM situations more gracefully
Johannes Weiner [Wed, 16 Oct 2013 20:46:59 +0000 (13:46 -0700)]
mm: memcg: handle non-error OOM situations more gracefully

Commit 3812c8c8f395 ("mm: memcg: do not trap chargers with full
callstack on OOM") assumed that only a few places that can trigger a
memcg OOM situation do not return VM_FAULT_OOM, like optional page cache
readahead.  But there are many more and it's impractical to annotate
them all.

First of all, we don't want to invoke the OOM killer when the failed
allocation is gracefully handled, so defer the actual kill to the end of
the fault handling as well.  This simplifies the code quite a bit for
added bonus.

Second, since a failed allocation might not be the abrupt end of the
fault, the memcg OOM handler needs to be re-entrant until the fault
finishes for subsequent allocation attempts.  If an allocation is
attempted after the task already OOMed, allow it to bypass the limit so
that it can quickly finish the fault and invoke the OOM killer.

Reported-by: azurIt <azurit@pobox.sk>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agotools/testing/selftests: fix uninitialized variable
Felipe Pena [Wed, 16 Oct 2013 20:46:58 +0000 (13:46 -0700)]
tools/testing/selftests: fix uninitialized variable

The err variable is intended to receive the timer_create() return before
checking it

Signed-off-by: Felipe Pena <felipensp@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoblock/partitions/efi.c: treat size mismatch as a warning, not an error
Doug Anderson [Wed, 16 Oct 2013 20:46:57 +0000 (13:46 -0700)]
block/partitions/efi.c: treat size mismatch as a warning, not an error

In commit 27a7c642174e ("partitions/efi: account for pmbr size in lba")
we started treating bad sizes in lba field of the partition that has the
0xEE (GPT protective) as errors.

However, we may run into these "bad sizes" in the real world if someone
uses dd to copy an image from a smaller disk to a bigger disk.  Since
this case used to work (even without using force_gpt), keep it working
and treat the size mismatch as a warning instead of an error.

Reported-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Tested-by: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
Andrea Arcangeli [Wed, 16 Oct 2013 20:46:56 +0000 (13:46 -0700)]
mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages

Commit 11feeb498086 ("kvm: optimize away THP checks in
kvm_is_mmio_pfn()") introduced a memory leak when KVM is run on gigantic
compound pages.

That commit depends on the assumption that PG_reserved is identical for
all head and tail pages of a compound page.  So that if get_user_pages
returns a tail page, we don't need to check the head page in order to
know if we deal with a reserved page that requires different
refcounting.

The assumption that PG_reserved is the same for head and tail pages is
certainly correct for THP and regular hugepages, but gigantic hugepages
allocated through bootmem don't clear the PG_reserved on the tail pages
(the clearing of PG_reserved is done later only if the gigantic hugepage
is freed).

This patch corrects the gigantic compound page initialization so that we
can retain the optimization in 11feeb498086.  The cacheline was already
modified in order to set PG_tail so this won't affect the boot time of
large memory systems.

[akpm@linux-foundation.org: tweak comment layout and grammar]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: andy123 <ajs124.ajs124@gmail.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Acked-by: Rafael Aquini <aquini@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm/zswap: bugfix: memory leak when re-swapon
Weijie Yang [Wed, 16 Oct 2013 20:46:54 +0000 (13:46 -0700)]
mm/zswap: bugfix: memory leak when re-swapon

zswap_tree is not freed when swapoff, and it got re-kmalloced in swapon,
so a memory leak occurs.

Free the memory of zswap_tree in zswap_frontswap_invalidate_area().

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
From: Weijie Yang <weijie.yang@samsung.com>
Subject: mm/zswap: bugfix: memory leak when invalidate and reclaim occur concurrently

Consider the following scenario:
thread 0: reclaim entry x (get refcount, but not call zswap_get_swap_cache_page)
thread 1: call zswap_frontswap_invalidate_page to invalidate entry x.
finished, entry x and its zbud is not freed as its refcount != 0
now, the swap_map[x] = 0
thread 0: now call zswap_get_swap_cache_page
swapcache_prepare return -ENOENT because entry x is not used any more
zswap_get_swap_cache_page return ZSWAP_SWAPCACHE_NOMEM
zswap_writeback_entry do nothing except put refcount
Now, the memory of zswap_entry x and its zpage leak.

Modify:
 - check the refcount in fail path, free memory if it is not referenced.

 - use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path
   can be not only caused by nomem but also by invalidate.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
Cyrill Gorcunov [Wed, 16 Oct 2013 20:46:53 +0000 (13:46 -0700)]
mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages

If a page we are inspecting is in swap we may occasionally report it as
having soft dirty bit (even if it is clean).  The pte_soft_dirty helper
should be called on present pte only.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: migration: do not lose soft dirty bit if page is in migration state
Cyrill Gorcunov [Wed, 16 Oct 2013 20:46:51 +0000 (13:46 -0700)]
mm: migration: do not lose soft dirty bit if page is in migration state

If page migration is turned on in config and the page is migrating, we
may lose the soft dirty bit.  If fork and mprotect are called on
migrating pages (once migration is complete) pages do not obtain the
soft dirty bit in the correspond pte entries.  Fix it adding an
appropriate test on swap entries.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agogcov: MAINTAINERS: Add an entry for gcov
Peter Oberparleiter [Wed, 16 Oct 2013 20:46:49 +0000 (13:46 -0700)]
gcov: MAINTAINERS: Add an entry for gcov

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm/hugetlb.c: correct missing private flag clearing
Joonsoo Kim [Wed, 16 Oct 2013 20:46:48 +0000 (13:46 -0700)]
mm/hugetlb.c: correct missing private flag clearing

We should clear the page's private flag when returing the page to the
hugepage pool.  Otherwise, marked hugepage can be allocated to the user
who tries to allocate the non-reserved hugepage.  If this user fail to
map this hugepage, he would try to return the page to the hugepage pool.
Since this page has a private flag, resv_huge_pages would mistakenly
increase.  This patch fixes this situation.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm/vmscan.c: don't forget to free shrinker->nr_deferred
Andrew Vagin [Wed, 16 Oct 2013 20:46:46 +0000 (13:46 -0700)]
mm/vmscan.c: don't forget to free shrinker->nr_deferred

This leak was added by commit 1d3d4437eae1 ("vmscan: per-node deferred
work").

unreferenced object 0xffff88006ada3bd0 (size 8):
  comm "criu", pid 14781, jiffies 4295238251 (age 105.641s)
  hex dump (first 8 bytes):
    00 00 00 00 00 00 00 00                          ........
  backtrace:
    [<ffffffff8170caee>] kmemleak_alloc+0x5e/0xc0
    [<ffffffff811c0527>] __kmalloc+0x247/0x310
    [<ffffffff8117848c>] register_shrinker+0x3c/0xa0
    [<ffffffff811e115b>] sget+0x5ab/0x670
    [<ffffffff812532f4>] proc_mount+0x54/0x170
    [<ffffffff811e1893>] mount_fs+0x43/0x1b0
    [<ffffffff81202dd2>] vfs_kern_mount+0x72/0x110
    [<ffffffff81202e89>] kern_mount_data+0x19/0x30
    [<ffffffff812530a0>] pid_ns_prepare_proc+0x20/0x40
    [<ffffffff81083c56>] alloc_pid+0x466/0x4a0
    [<ffffffff8105aeda>] copy_process+0xc6a/0x1860
    [<ffffffff8105beab>] do_fork+0x8b/0x370
    [<ffffffff8105c1a6>] SyS_clone+0x16/0x20
    [<ffffffff8171f739>] stub_clone+0x69/0x90
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoipc/sem.c: synchronize semop and semctl with IPC_RMID
Manfred Spraul [Wed, 16 Oct 2013 20:46:45 +0000 (13:46 -0700)]
ipc/sem.c: synchronize semop and semctl with IPC_RMID

After acquiring the semlock spinlock, operations must test that the
array is still valid.

 - semctl() and exit_sem() would walk stale linked lists (ugly, but
   should be ok: all lists are empty)

 - semtimedop() would sleep forever - and if woken up due to a signal -
   access memory after free.

The patch also:
 - standardizes the tests for .deleted, so that all tests in one
   function leave the function with the same approach.
 - unconditionally tests for .deleted immediately after every call to
   sem_lock - even it it means that for semctl(GETALL), .deleted will be
   tested twice.

Both changes make the review simpler: After every sem_lock, there must
be a test of .deleted, followed by a goto to the cleanup code (if the
function uses "goto cleanup").

The only exception is semctl_down(): If sem_ids().rwsem is locked, then
the presence in ids->ipcs_idr is equivalent to !.deleted, thus no
additional test is required.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Mike Galbraith <efault@gmx.de>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoipc: update locking scheme comments
Davidlohr Bueso [Wed, 16 Oct 2013 20:46:45 +0000 (13:46 -0700)]
ipc: update locking scheme comments

The initial documentation was a bit incomplete, update accordingly.

[akpm@linux-foundation.org: make it more readable in 80 columns]
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Acked-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm, memcg: protect mem_cgroup_read_events for cpu hotplug
David Rientjes [Wed, 16 Oct 2013 20:46:43 +0000 (13:46 -0700)]
mm, memcg: protect mem_cgroup_read_events for cpu hotplug

for_each_online_cpu() needs the protection of {get,put}_online_cpus() so
cpu_online_mask doesn't change during the iteration.

cpu_hotplug.lock is held while a cpu is going down, it's a coarse lock
that is used kernel-wide to synchronize cpu hotplug activity.  Memcg has
a cpu hotplug notifier, called while there may not be any cpu hotplug
refcounts, which drains per-cpu event counts to memcg->nocpu_base.events
to maintain a cumulative event count as cpus disappear.  Without
get_online_cpus() in mem_cgroup_read_events(), it's possible to account
for the event count on a dying cpu twice, and this value may be
significantly large.

In fact, all memcg->pcp_counter_lock use should be nested by
{get,put}_online_cpus().

This fixes that issue and ensures the reported statistics are not vastly
over-reported during cpu hotplug.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agokernel: add support for init_array constructors
Frantisek Hrbata [Mon, 14 Oct 2013 07:38:46 +0000 (18:08 +1030)]
kernel: add support for init_array constructors

This adds the .init_array section as yet another section with constructors. This
is needed because gcc could add __gcov_init calls to .init_array or .ctors
section, depending on gcc (and binutils) version .

v2: - reuse mod->ctors for .init_array section for modules, because gcc uses
      .ctors or .init_array, but not both at the same time
v3: - fail to load if that does happen somehow.

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agodriver core: Release device_hotplug_lock when store_mem_state returns EINVAL
Yasuaki Ishimatsu [Fri, 11 Oct 2013 06:36:25 +0000 (15:36 +0900)]
driver core: Release device_hotplug_lock when store_mem_state returns EINVAL

When inserting a wrong value to /sys/devices/system/memory/memoryX/state file,
following messages are shown. And device_hotplug_lock is never released.

================================================
[ BUG: lock held when returning to user space! ]
3.12.0-rc4-debug+ #3 Tainted: G        W
------------------------------------------------
bash/6442 is leaving the kernel with locks still held!
1 lock held by bash/6442:
 #0:  (device_hotplug_lock){+.+.+.}, at: [<ffffffff8146cbb5>] lock_device_hotplug_sysfs+0x15/0x50

This issue was introdued by commit fa2be40 (drivers: base: use standard
device online/offline for state change).

This patch releases device_hotplug_lcok when store_mem_state returns EINVAL.

Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
CC: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agovirtio_config: remove virtio_config_val
Rusty Russell [Mon, 14 Oct 2013 07:41:51 +0000 (18:11 +1030)]
virtio_config: remove virtio_config_val

The virtio_cread() functions should now be used.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agovirtio: use size-based config accessors.
Rusty Russell [Mon, 14 Oct 2013 07:41:51 +0000 (18:11 +1030)]
virtio: use size-based config accessors.

This lets the transport do endian conversion if necessary, and insulates
the drivers from the difference.

Most drivers can use the simple helpers virtio_cread() and virtio_cwrite().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agovirtio_config: introduce size-based accessors.
Rusty Russell [Mon, 14 Oct 2013 07:41:51 +0000 (18:11 +1030)]
virtio_config: introduce size-based accessors.

This lets the us do endian conversion if necessary, and insulates the
drivers from that change.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agovirtio_ring: plug kmemleak false positive.
Rusty Russell [Mon, 14 Oct 2013 07:38:45 +0000 (18:08 +1030)]
virtio_ring: plug kmemleak false positive.

unreferenced object 0xffff88003d467e20 (size 32):
  comm "softirq", pid 0, jiffies 4295197765 (age 6.364s)
  hex dump (first 32 bytes):
    28 19 bf 3d 00 00 00 00 0c 00 00 00 01 00 01 00  (..=............
    02 dc 51 3c 00 00 00 00 56 00 00 00 00 00 00 00  ..Q<....V.......
  backtrace:
    [<ffffffff8152db19>] kmemleak_alloc+0x59/0xc0
    [<ffffffff81102e93>] __kmalloc+0xf3/0x180
    [<ffffffff812db5d6>] vring_add_indirect+0x36/0x280
    [<ffffffff812dc59f>] virtqueue_add_outbuf+0xbf/0x4e0
    [<ffffffff813a8b30>] start_xmit+0x1a0/0x3b0
    [<ffffffff81445861>] dev_hard_start_xmit+0x2d1/0x4d0
    [<ffffffff81460052>] sch_direct_xmit+0xf2/0x1c0
    [<ffffffff81445c28>] dev_queue_xmit+0x1c8/0x460
    [<ffffffff814e3187>] ip6_finish_output2+0x1d7/0x470
    [<ffffffff814e34b0>] ip6_finish_output+0x90/0xb0
    [<ffffffff814e3507>] ip6_output+0x37/0xb0
    [<ffffffff815021eb>] igmp6_send+0x2db/0x470
    [<ffffffff81502645>] igmp6_timer_handler+0x95/0xa0
    [<ffffffff8104b57c>] call_timer_fn+0x2c/0x90
    [<ffffffff8104b7ba>] run_timer_softirq+0x1da/0x1f0
    [<ffffffff81045721>] __do_softirq+0xd1/0x1b0

Address gets embedded in a descriptor via virt_to_phys().  See detach_buf,
which frees it:

if (vq->vring.desc[i].flags & VRING_DESC_F_INDIRECT)
kfree(phys_to_virt(vq->vring.desc[i].addr));

Reported-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix-suggested-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Typing-done-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Thu, 17 Oct 2013 00:18:18 +0000 (17:18 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull tmpfile fix from Al Viro:
 "A fix for double iput() in ->tmpfile() on ext3 and ext4; I'd fucked it
  up, Miklos has caught it"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  ext[34]: fix double put in tmpfile

11 years agoMerge tag 'dm-3.12-fix-cve' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
Linus Torvalds [Thu, 17 Oct 2013 00:16:57 +0000 (17:16 -0700)]
Merge tag 'dm-3.12-fix-cve' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device-mapper fix from Alasdair Kergon:
 "A patch to avoid data corruption in a device-mapper snapshot.

  This is primarily a data corruption bug that all users of
  device-mapper snapshots will want to fix.  The CVE is due to a data
  leak under specific circumstances if, for example, the snapshot is
  presented to a virtual machine: a block written as data inside the VM
  can get interpreted incorrectly on the host outside the VM as
  metadata, causing the host to provide the VM with access to blocks it
  would not otherwise see.  This is likely to affect few, if any,
  people"

* tag 'dm-3.12-fix-cve' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm snapshot: fix data corruption

11 years agoMerge tag 'gpio-v3.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Thu, 17 Oct 2013 00:15:57 +0000 (17:15 -0700)]
Merge tag 'gpio-v3.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull gpio fixes from Linus Walleij:
 "Three GPIO fixes for the v3.12 series:
   - A fix to the Lynxpoint IRQ handler
   - Two late fixes to fallout from the gpiod refactoring"

* tag 'gpio-v3.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpiolib: let gpiod_request() return -EPROBE_DEFER
  gpiolib: safer implementation of desc_to_gpio()
  gpio/lynxpoint: check if the interrupt is enabled in IRQ handler