]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agonet/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy
Alex Bligh [Tue, 20 Mar 2012 23:48:01 +0000 (10:48 +1100)]
net/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy

Problem:

A repeatable Oops can be caused if a container with networking
unshared is destroyed when it has nf_conntrack entries yet to expire.

A copy of the oops follows below. A perl program generating the oops
repeatably is attached inline below.

Analysis:

The oops is called from cleanup_net when the namespace is
destroyed. conntrack iterates through outstanding events and calls
death_by_timeout on each of them, which in turn produces a call to
ctnetlink_conntrack_event. This calls nf_netlink_has_listeners, which
oopses because net->nfnl is NULL.

The perl program generates the container through fork() then
clone(NS_NEWNET). I does not explicitly set up netlink
explicitly set up netlink, but I presume it was set up else net->nfnl
would have been NULL earlier (i.e. when an earlier connection
timed out). This would thus suggest that net->nfnl is made NULL
during the destruction of the container, which I think is done by
nfnetlink_net_exit_batch.

I can see that the various subsystems are deinitialised in the opposite
order to which the relevant register_pernet_subsys calls are called,
and both nf_conntrack and nfnetlink_net_ops register their relevant
subsystems. If nfnetlink_net_ops registered later than nfconntrack,
then its exit routine would have been called first, which would cause
the oops described. I am not sure there is anything to prevent this
happening in a container environment.

Whilst there's perhaps a more complex problem revolving around ordering
of subsystem deinit, it seems to me that missing a netlink event on a
container that is dying is not a disaster. An early check for net->nfnl
being non-NULL in ctnetlink_conntrack_event appears to fix this. There
may remain a potential race condition if it becomes NULL immediately
after being checked (I am not sure any lock is held at this point or
how synchronisation for subsystem deinitialization works).

Patch:

The patch attached should apply on everything from 2.6.26 (if not before)
onwards; it appears to be a problem on all kernels. This was taken against
Ubuntu-3.0.0-11.17 which is very close to 3.0.4. I have torture-tested it
with the above perl script for 15 minutes or so; the perl script hung the
machine within 20 seconds without this patch.

Applicability:

If this is the right solution, it should be applied to all stable kernels
as well as head. Apart from the minor overhead of checking one variable
against NULL, it can never 'do the wrong thing', because if net->nfnl
is NULL, an oops will inevitably result. Therefore, checking is a reasonable
thing to do unless it can be proven than net->nfnl will never be NULL.

Check net->nfnl for NULL in ctnetlink_conntrack_event to avoid Oops on
container destroy

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Cc: Patrick McHardy <kaber@trash.net>
Cc: David Miller <davem@davemloft.net>
Cc: <stable@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agoMerge remote-tracking branch 'cpuidle-cons/cpuidle_consol_pull'
Stephen Rothwell [Mon, 2 Apr 2012 03:17:03 +0000 (13:17 +1000)]
Merge remote-tracking branch 'cpuidle-cons/cpuidle_consol_pull'

Conflicts:
arch/arm/include/asm/cpuidle.h
arch/arm/mach-at91/cpuidle.c
arch/arm/mach-davinci/cpuidle.c
arch/arm/mach-shmobile/cpuidle.c
drivers/cpuidle/cpuidle.c
include/linux/cpuidle.h

12 years agoMerge remote-tracking branch 'dma-buf/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 03:13:29 +0000 (13:13 +1000)]
Merge remote-tracking branch 'dma-buf/for-next'

Conflicts:
include/linux/dma-buf.h

12 years agoMerge remote-tracking branch 'dma-mapping/dma-mapping-next'
Stephen Rothwell [Mon, 2 Apr 2012 03:08:29 +0000 (13:08 +1000)]
Merge remote-tracking branch 'dma-mapping/dma-mapping-next'

12 years agoMerge remote-tracking branch 'kvmtool/master'
Stephen Rothwell [Mon, 2 Apr 2012 03:06:56 +0000 (13:06 +1000)]
Merge remote-tracking branch 'kvmtool/master'

12 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 03:05:24 +0000 (13:05 +1000)]
Merge remote-tracking branch 'arm-soc/for-next'

12 years agoMerge remote-tracking branch 'irqdomain/irqdomain/next'
Stephen Rothwell [Mon, 2 Apr 2012 02:59:09 +0000 (12:59 +1000)]
Merge remote-tracking branch 'irqdomain/irqdomain/next'

Conflicts:
arch/arm/Kconfig

12 years agoMerge remote-tracking branch 'modem-shm/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:57:33 +0000 (12:57 +1000)]
Merge remote-tracking branch 'modem-shm/for-next'

12 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:57:27 +0000 (12:57 +1000)]
Merge remote-tracking branch 'vhost/linux-next'

12 years agoMerge remote-tracking branch 'moduleh/for-sfr'
Stephen Rothwell [Mon, 2 Apr 2012 02:55:54 +0000 (12:55 +1000)]
Merge remote-tracking branch 'moduleh/for-sfr'

12 years agoMerge remote-tracking branch 'tmem/linux-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:53:48 +0000 (12:53 +1000)]
Merge remote-tracking branch 'tmem/linux-next'

12 years agoMerge remote-tracking branch 'hsi/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:52:02 +0000 (12:52 +1000)]
Merge remote-tracking branch 'hsi/for-next'

12 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:50:29 +0000 (12:50 +1000)]
Merge remote-tracking branch 'regmap/for-next'

12 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:48:41 +0000 (12:48 +1000)]
Merge remote-tracking branch 'xen-two/linux-next'

Conflicts:
arch/x86/include/asm/io_apic.h
arch/x86/kernel/apic/io_apic.c

12 years agoMerge remote-tracking branch 'xen/upstream/xen'
Stephen Rothwell [Mon, 2 Apr 2012 02:48:34 +0000 (12:48 +1000)]
Merge remote-tracking branch 'xen/upstream/xen'

Conflicts:
arch/x86/include/asm/cmpxchg.h

12 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Mon, 2 Apr 2012 02:41:02 +0000 (12:41 +1000)]
Merge remote-tracking branch 'tip/auto-latest'

Conflicts:
Documentation/feature-removal-schedule.txt

12 years agoMerge remote-tracking branch 'spi/spi/next'
Stephen Rothwell [Mon, 2 Apr 2012 02:12:52 +0000 (12:12 +1000)]
Merge remote-tracking branch 'spi/spi/next'

12 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:12:46 +0000 (12:12 +1000)]
Merge remote-tracking branch 'edac-amd/for-next'

12 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:10:38 +0000 (12:10 +1000)]
Merge remote-tracking branch 'fsnotify/for-next'

12 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:04:38 +0000 (12:04 +1000)]
Merge remote-tracking branch 'pm/linux-next'

12 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 02:03:00 +0000 (12:03 +1000)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
drivers/net/ethernet/realtek/r8169.c

12 years agoMerge remote-tracking branch 'selinux/master'
Stephen Rothwell [Mon, 2 Apr 2012 02:01:01 +0000 (12:01 +1000)]
Merge remote-tracking branch 'selinux/master'

12 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:59:20 +0000 (11:59 +1000)]
Merge remote-tracking branch 'regulator/for-next'

12 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:57:29 +0000 (11:57 +1000)]
Merge remote-tracking branch 'md/for-next'

12 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:50:29 +0000 (11:50 +1000)]
Merge remote-tracking branch 'slab/for-next'

12 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:48:30 +0000 (11:48 +1000)]
Merge remote-tracking branch 'kgdb/kgdb-next'

12 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:46:56 +0000 (11:46 +1000)]
Merge remote-tracking branch 'mmc/mmc-next'

12 years agoMerge branch 'quilt/device-mapper'
Stephen Rothwell [Mon, 2 Apr 2012 01:46:43 +0000 (11:46 +1000)]
Merge branch 'quilt/device-mapper'

12 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:42:29 +0000 (11:42 +1000)]
Merge remote-tracking branch 'cgroup/for-next'

12 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Mon, 2 Apr 2012 01:35:16 +0000 (11:35 +1000)]
Merge branch 'quilt/rr'

Conflicts:
arch/arm/kernel/kprobes.c
drivers/virtio/virtio_balloon.c

12 years agoMerge commit 'refs/next/20120330/sound-asoc'
Stephen Rothwell [Mon, 2 Apr 2012 01:32:21 +0000 (11:32 +1000)]
Merge commit 'refs/next/20120330/sound-asoc'

12 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:19:50 +0000 (11:19 +1000)]
Merge remote-tracking branch 'sound/for-next'

12 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Mon, 2 Apr 2012 01:18:22 +0000 (11:18 +1000)]
Merge remote-tracking branch 'crypto/master'

12 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Mon, 2 Apr 2012 01:18:18 +0000 (11:18 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
drivers/dma/mxs-dma.c
drivers/mmc/host/mxs-mmc.c
drivers/mtd/devices/spear_smi.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/atmel_nand.c
drivers/mtd/nand/docg4.c
drivers/mtd/nand/gpmi-nand/gpmi-lib.c
fs/jffs2/fs.c
include/linux/mtd/spear_smi.h
sound/soc/mxs/mxs-pcm.h

12 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Mon, 2 Apr 2012 01:08:34 +0000 (11:08 +1000)]
Merge remote-tracking branch 'bluetooth/master'

12 years agoMerge remote-tracking branch 'dmaengine/next'
Stephen Rothwell [Mon, 2 Apr 2012 01:07:02 +0000 (11:07 +1000)]
Merge remote-tracking branch 'dmaengine/next'

12 years agoMerge remote-tracking branch 'isci/all'
Stephen Rothwell [Mon, 2 Apr 2012 01:05:23 +0000 (11:05 +1000)]
Merge remote-tracking branch 'isci/all'

12 years agoMerge remote-tracking branch 'target-merge/for-next-merge'
Stephen Rothwell [Mon, 2 Apr 2012 01:03:46 +0000 (11:03 +1000)]
Merge remote-tracking branch 'target-merge/for-next-merge'

12 years agoMerge remote-tracking branch 'ieee1394/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:03:28 +0000 (11:03 +1000)]
Merge remote-tracking branch 'ieee1394/for-next'

12 years agoMerge remote-tracking branch 'infiniband/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:03:14 +0000 (11:03 +1000)]
Merge remote-tracking branch 'infiniband/for-next'

12 years agoMerge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:03:08 +0000 (11:03 +1000)]
Merge remote-tracking branch 'kconfig/for-next'

12 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:03:01 +0000 (11:03 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

12 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Mon, 2 Apr 2012 01:01:33 +0000 (11:01 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

12 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Mon, 2 Apr 2012 01:00:04 +0000 (11:00 +1000)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

12 years agoMerge branch 'quilt/jdelvare-hwmon'
Stephen Rothwell [Mon, 2 Apr 2012 01:00:02 +0000 (11:00 +1000)]
Merge branch 'quilt/jdelvare-hwmon'

12 years agoMerge remote-tracking branch 'bjdooks-i2c/next-i2c'
Stephen Rothwell [Mon, 2 Apr 2012 00:59:58 +0000 (10:59 +1000)]
Merge remote-tracking branch 'bjdooks-i2c/next-i2c'

Conflicts:
drivers/i2c/busses/i2c-omap.c

12 years agoMerge remote-tracking branch 'fuse/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 00:58:11 +0000 (10:58 +1000)]
Merge remote-tracking branch 'fuse/for-next'

12 years agoMerge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Mon, 2 Apr 2012 00:56:40 +0000 (10:56 +1000)]
Merge remote-tracking branch 'ecryptfs/next'

Conflicts:
fs/ecryptfs/ecryptfs_kernel.h

12 years agoMerge remote-tracking branch 'cifs/master'
Stephen Rothwell [Mon, 2 Apr 2012 00:50:17 +0000 (10:50 +1000)]
Merge remote-tracking branch 'cifs/master'

12 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Mon, 2 Apr 2012 00:37:38 +0000 (10:37 +1000)]
Merge remote-tracking branch 'tile/master'

Conflicts:
arch/tile/include/asm/barrier.h
arch/tile/include/asm/pgtable.h

12 years agoMerge remote-tracking branch 'sparc-next/master'
Stephen Rothwell [Mon, 2 Apr 2012 00:10:36 +0000 (10:10 +1000)]
Merge remote-tracking branch 'sparc-next/master'

12 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Mon, 2 Apr 2012 00:09:06 +0000 (10:09 +1000)]
Merge remote-tracking branch 's390/features'

12 years agoMerge remote-tracking branch 'galak/next'
Stephen Rothwell [Mon, 2 Apr 2012 00:07:40 +0000 (10:07 +1000)]
Merge remote-tracking branch 'galak/next'

12 years agoMerge remote-tracking branch 'mpc5xxx/next'
Stephen Rothwell [Mon, 2 Apr 2012 00:07:38 +0000 (10:07 +1000)]
Merge remote-tracking branch 'mpc5xxx/next'

12 years agoMerge remote-tracking branch 'parisc/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 00:07:34 +0000 (10:07 +1000)]
Merge remote-tracking branch 'parisc/for-next'

12 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Mon, 2 Apr 2012 00:07:32 +0000 (10:07 +1000)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

12 years agoMerge remote-tracking branch 'microblaze/next'
Stephen Rothwell [Mon, 2 Apr 2012 00:06:06 +0000 (10:06 +1000)]
Merge remote-tracking branch 'microblaze/next'

12 years agoMerge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Mon, 2 Apr 2012 00:04:39 +0000 (10:04 +1000)]
Merge remote-tracking branch 'm68k/for-next'

12 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Mon, 2 Apr 2012 00:03:12 +0000 (10:03 +1000)]
Merge remote-tracking branch 'ia64/next'

12 years agoMerge branch 'quilt/hexagon'
Stephen Rothwell [Mon, 2 Apr 2012 00:01:44 +0000 (10:01 +1000)]
Merge branch 'quilt/hexagon'

Conflicts:
arch/hexagon/Kconfig

12 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Sun, 1 Apr 2012 23:59:49 +0000 (09:59 +1000)]
Merge remote-tracking branch 'cris/for-next'

12 years agoMerge remote-tracking branch 'blackfin/for-linus'
Stephen Rothwell [Sun, 1 Apr 2012 23:58:23 +0000 (09:58 +1000)]
Merge remote-tracking branch 'blackfin/for-linus'

12 years agoMerge remote-tracking branch 'gpio-current/gpio/merge'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:25 +0000 (09:56 +1000)]
Merge remote-tracking branch 'gpio-current/gpio/merge'

12 years agoMerge remote-tracking branch 'spi-current/spi/merge'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:24 +0000 (09:56 +1000)]
Merge remote-tracking branch 'spi-current/spi/merge'

12 years agoMerge remote-tracking branch 'crypto-current/master'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:17 +0000 (09:56 +1000)]
Merge remote-tracking branch 'crypto-current/master'

12 years agoMerge remote-tracking branch 'net/master'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:11 +0000 (09:56 +1000)]
Merge remote-tracking branch 'net/master'

12 years agoMerge remote-tracking branch 'sparc/master'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:10 +0000 (09:56 +1000)]
Merge remote-tracking branch 'sparc/master'

12 years agoMerge remote-tracking branch 'm68k-current/for-linus'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:09 +0000 (09:56 +1000)]
Merge remote-tracking branch 'm68k-current/for-linus'

12 years agoMerge remote-tracking branch 'arm-current/fixes'
Stephen Rothwell [Sun, 1 Apr 2012 23:56:08 +0000 (09:56 +1000)]
Merge remote-tracking branch 'arm-current/fixes'

12 years agoMerge remote-tracking branch 'fixes/master'
Stephen Rothwell [Sun, 1 Apr 2012 23:49:21 +0000 (09:49 +1000)]
Merge remote-tracking branch 'fixes/master'

12 years agoipv6: Fix RTM_GETROUTE's interpretation of RTA_IIF to be consistent with ipv4
Shmulik Ladkani [Sun, 1 Apr 2012 04:03:45 +0000 (04:03 +0000)]
ipv6: Fix RTM_GETROUTE's interpretation of RTA_IIF to be consistent with ipv4

In IPv4, if an RTA_IIF attribute is specified within an RTM_GETROUTE
message, then a route is searched as if a packet was received on the
specified 'iif' interface.

However in IPv6, RTA_IIF is not interpreted in the same way:
'inet6_rtm_getroute()' always calls 'ip6_route_output()', regardless the
RTA_IIF attribute.

As a result, in IPv6 there's no way to use RTM_GETROUTE in order to look
for a route as if a packet was received on a specific interface.

Fix 'inet6_rtm_getroute()' so that RTA_IIF is interpreted as "lookup a
route as if a packet was received on the specified interface", similar
to IPv4's 'inet_rtm_getroute()' interpretation.

Reported-by: Ami Koren <amikoren@yahoo.com>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosparc: pgtable_64: change include order
Aaro Koskinen [Sun, 1 Apr 2012 08:54:38 +0000 (08:54 +0000)]
sparc: pgtable_64: change include order

Fix the following build breakage in v3.4-rc1:

  CC      arch/sparc/kernel/cpu.o
In file included from /home/aaro/git/linux/arch/sparc/include/asm/pgtable_64.h:15:0,
                 from /home/aaro/git/linux/arch/sparc/include/asm/pgtable.h:4,
                 from arch/sparc/kernel/cpu.c:15:
include/asm-generic/pgtable-nopud.h:13:16: error: unknown type name 'pgd_t'
include/asm-generic/pgtable-nopud.h:25:28: error: unknown type name 'pgd_t'
include/asm-generic/pgtable-nopud.h:26:27: error: unknown type name 'pgd_t'
include/asm-generic/pgtable-nopud.h:27:31: error: unknown type name 'pgd_t'
include/asm-generic/pgtable-nopud.h:28:30: error: unknown type name 'pgd_t'
include/asm-generic/pgtable-nopud.h:38:34: error: unknown type name 'pgd_t'
In file included from /home/aaro/git/linux/arch/sparc/include/asm/pgtable_64.h:783:0,
                 from /home/aaro/git/linux/arch/sparc/include/asm/pgtable.h:4,
                 from arch/sparc/kernel/cpu.c:15:
include/asm-generic/pgtable.h: In function 'pgd_none_or_clear_bad':
include/asm-generic/pgtable.h:258:2: error: implicit declaration of function 'pgd_none' [-Werror=implicit-function-declaration]
include/asm-generic/pgtable.h:260:2: error: implicit declaration of function 'pgd_bad' [-Werror=implicit-function-declaration]
include/asm-generic/pgtable.h: In function 'pud_none_or_clear_bad':
include/asm-generic/pgtable.h:269:6: error: request for member 'pgd' in something not a structure or union

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoscsi/atari: Make more functions static
Geert Uytterhoeven [Sun, 12 Jun 2011 18:48:33 +0000 (20:48 +0200)]
scsi/atari: Make more functions static

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@googlemail.com>
Cc: James E.J. Bottomley <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
12 years agoscsi/atari: Revive "atascsi=" setup option
Geert Uytterhoeven [Sun, 18 Mar 2012 10:54:40 +0000 (11:54 +0100)]
scsi/atari: Revive "atascsi=" setup option

It was documented in Documentation/m68k/kernel-options.txt and
Documentation/scsi/scsi-parameters.txt, but the implementation was
missing.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@googlemail.com>
Cc: James E.J. Bottomley <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
12 years agonet/ariadne: Improve debug prints
Geert Uytterhoeven [Mon, 27 Jun 2011 21:09:20 +0000 (23:09 +0200)]
net/ariadne: Improve debug prints

Remove casts and use proper printf()-style format specifiers instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Acked-by: David S. Miller <davem@davemloft.net>
12 years agom68k/atari: Change VME irq numbers from unsigned long to unsigned int
Geert Uytterhoeven [Thu, 18 Aug 2011 18:01:51 +0000 (20:01 +0200)]
m68k/atari: Change VME irq numbers from unsigned long to unsigned int

Device interrupts numbers were changed to unsigned int in 1997, the year
IRQ_MACHSPEC was killed as well.

Also kill a related cast while we're at it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: netdev@vger.kernel.org
12 years agom68k/amiga: Use arch_initcall() for registering platform devices
Geert Uytterhoeven [Sun, 22 Jan 2012 11:45:45 +0000 (12:45 +0100)]
m68k/amiga: Use arch_initcall() for registering platform devices

module_init() maps to device_initcall(), opening the possibility of
race conditions between platform_driver_probe() and registering platform
devices.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k/amiga: Add error checks when registering platform devices
Geert Uytterhoeven [Sun, 22 Jan 2012 11:44:25 +0000 (12:44 +0100)]
m68k/amiga: Add error checks when registering platform devices

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k/amiga: Mark z_dev_present() __init
Geert Uytterhoeven [Sun, 22 Jan 2012 11:25:55 +0000 (12:25 +0100)]
m68k/amiga: Mark z_dev_present() __init

It's called from amiga_init_devices() only, which is __init.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: Remove unused MAX_NOINT_IPL definition
Geert Uytterhoeven [Sun, 19 Jun 2011 09:13:31 +0000 (11:13 +0200)]
m68k: Remove unused MAX_NOINT_IPL definition

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k/q40: Add missing platform check before registering platform devices
Geert Uytterhoeven [Sun, 18 Mar 2012 12:20:27 +0000 (13:20 +0100)]
m68k/q40: Add missing platform check before registering platform devices

On multi-platform kernels, the Q40/Q60 platform devices should be
registered when running on Q40/Q60 only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k/mac: Add missing platform check before registering platform devices
Geert Uytterhoeven [Sun, 18 Mar 2012 12:21:38 +0000 (13:21 +0100)]
m68k/mac: Add missing platform check before registering platform devices

On multi-platform kernels, the Mac platform devices should be registered
when running on Mac only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
12 years agom68k: include asm/cmpxchg.h in our m68k atomic.h
Greg Ungerer [Fri, 30 Mar 2012 05:52:09 +0000 (15:52 +1000)]
m68k: include asm/cmpxchg.h in our m68k atomic.h

After commit 9ffc93f203c18a70623f21950f1dd473c9ec48cd ("Remove all

  CC      init/main.o
In file included from include/linux/mm.h:15:0,
                 from include/linux/ring_buffer.h:5,
                 from include/linux/ftrace_event.h:4,
                 from include/trace/syscall.h:6,
                 from include/linux/syscalls.h:78,
                 from init/main.c:16:
include/linux/debug_locks.h: In function ‘__debug_locks_off’:
include/linux/debug_locks.h:16:2: error: implicit declaration of function ‘xchg’

There is no indirect inclusions of the new asm/cmpxchg.h for m68k here.
Looking at most other architectures they include asm/cmpxchg.h in their
asm/atomic.h. M68k currently does not do this. Including this in atomic.h
fixes all m68k build problems.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agonet: lpc_eth: Fix rename of dev_hw_addr_random
stigge@antcom.de [Wed, 28 Mar 2012 12:36:26 +0000 (12:36 +0000)]
net: lpc_eth: Fix rename of dev_hw_addr_random

In parallel to the integration of lpc_eth.c, dev_hw_addr_random() has been
renamed to eth_hw_addr_random(). This patch fixes it also in the new driver
lpc_eth.c.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/netfilter/nfnetlink_acct.c: use linux/atomic.h
Andrew Morton [Wed, 28 Mar 2012 12:10:57 +0000 (12:10 +0000)]
net/netfilter/nfnetlink_acct.c: use linux/atomic.h

There's no known problem here, but this is one of only two non-arch files
in the kernel which use asm/atomic.h instead of linux/atomic.h.

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorose_dev: fix memcpy-bug in rose_set_mac_address
danborkmann@iogearbox.net [Tue, 27 Mar 2012 22:47:43 +0000 (22:47 +0000)]
rose_dev: fix memcpy-bug in rose_set_mac_address

If both addresses equal, nothing needs to be done. If the device is down,
then we simply copy the new address to dev->dev_addr. If the device is up,
then we add another loopback device with the new address, and if that does
not fail, we remove the loopback device with the old address. And only
then, we update the dev->dev_addr.

Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoFix non TBI PHY access; a bad merge undid bug fix in a previous commit.
Kenth Eriksson [Tue, 27 Mar 2012 22:05:54 +0000 (22:05 +0000)]
Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.

The merge done in commit b26e478f undid bug fix in commit c3e072f8
("net: fsl_pq_mdio: fix non tbi phy access"), with the result that non
TBI (e.g. MDIO) PHYs cannot be accessed.

Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/garp: avoid infinite loop if attribute already exists
David Ward [Tue, 27 Mar 2012 09:01:52 +0000 (09:01 +0000)]
net/garp: avoid infinite loop if attribute already exists

An infinite loop occurred if garp_attr_create was called with the values
of an existing attribute. This might happen if a previous leave request
for the attribute has not yet been followed by a PDU transmission (or,
if the application previously issued a join request for the attribute
and is now issuing another one, without having issued a leave request).

If garp_attr_create finds an existing attribute having the same values,
return the address to it. Its state will then get updated (i.e., if it
was in a leaving state, it will move into a non-leaving state and not
get deleted during the next PDU transmission).

To accomplish this fix, collapse garp_attr_insert into garp_attr_create
(which is its only caller).

Thanks to Jorge Boncompte [DTI2] <jorge@dti2.net> for contributing to
this fix.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
David S. Miller [Sun, 1 Apr 2012 20:47:08 +0000 (16:47 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

12 years agoasm-generic: add linux/types.h to cmpxchg.h
Paul Gortmaker [Sun, 1 Apr 2012 18:41:36 +0000 (14:41 -0400)]
asm-generic: add linux/types.h to cmpxchg.h

Builds of the openrisc or1ksim_defconfig show the following:

  In file included from arch/openrisc/include/generated/asm/cmpxchg.h:1:0,
                   from include/asm-generic/atomic.h:18,
                   from arch/openrisc/include/generated/asm/atomic.h:1,
                   from include/linux/atomic.h:4,
                   from include/linux/dcache.h:4,
                   from fs/notify/fsnotify.c:19:
  include/asm-generic/cmpxchg.h: In function '__xchg':
  include/asm-generic/cmpxchg.h:34:20: error: expected ')' before 'u8'
  include/asm-generic/cmpxchg.h:34:20: warning: type defaults to 'int' in type name

and many more lines of similar errors.  It seems specific to the or32
because most other platforms have an arch specific component that would
have already included types.h ahead of time, but the o32 does not.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agotile: fix multiple build failures from system.h dismantle
Paul Gortmaker [Sun, 1 Apr 2012 18:16:21 +0000 (14:16 -0400)]
tile: fix multiple build failures from system.h dismantle

Commit bd119c69239322caafdb64517a806037d0d0c70a

    "Disintegrate asm/system.h for Tile"

created the asm/switch_to.h file, but did not add an include
of it to all its users.

Also, commit b4816afa3986704d1404fc48e931da5135820472

        "Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h"

introduced the concept of asm/cmpxchg.h but the tile arch
never got one.  Fork the cmpxchg content out of the asm/atomic.h
file to create one.

Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agofirewire: restore the device.h include in linux/firewire.h
Paul Gortmaker [Sun, 1 Apr 2012 17:52:38 +0000 (13:52 -0400)]
firewire: restore the device.h include in linux/firewire.h

Commit 313162d0b83836e2f57e51b9b8650fb4b9c396ea

    "device.h: audit and cleanup users in main include dir"

exchanged an include <linux/device.h> for a struct *device
but in actuality I misread this file when creating 313162d
and it should have remained an include.

There were no build regressions since all consumers were
already getting device.h anyway, but make it right regardless.

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agofrv: fix warnings in mb93090-mb00/pci-dma.c about implicit EXPORT_SYMBOL
Paul Gortmaker [Sun, 1 Apr 2012 17:45:53 +0000 (13:45 -0400)]
frv: fix warnings in mb93090-mb00/pci-dma.c about implicit EXPORT_SYMBOL

To fix:

arch/frv/mb93090-mb00/pci-dma.c:31:1: warning: data definition has no type or storage class [enabled by default]
arch/frv/mb93090-mb00/pci-dma.c:31:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL' [-Wimplicit-int]
arch/frv/mb93090-mb00/pci-dma.c:31:1: warning: parameter names (without types) in function declaration [enabled by default]
arch/frv/mb93090-mb00/pci-dma.c:38:1: warning: data definition has no type or storage class [enabled by default]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agosh: fix several build failures from system.h fallout
Paul Gortmaker [Sun, 1 Apr 2012 17:37:35 +0000 (13:37 -0400)]
sh: fix several build failures from system.h fallout

commit e839ca528718e68cad32a307dc9aabf01ef3eb05

    "Disintegrate asm/system.h for SH"

created the new file asm/cache_insns.h but it didn't add
an include for all the users of it.

The failure on fpu.c (also seen below) showed up roughly
at the same time, and since the fix is trivial (include traps.h)
I did not bother to bisect to 100% confirm it was caused by
the system.h disintegration.

arch/sh/mm/flush-sh4.c:16:2: error: implicit declaration of function 'register_align' [-Werror=implicit-function-declaration]
arch/sh/mm/flush-sh4.c:23:3: error: implicit declaration of function '__ocbwb' [-Werror=implicit-function-declaration]
arch/sh/mm/flush-sh4.c:57:3: error: implicit declaration of function '__ocbp' [-Werror=implicit-function-declaration]
arch/sh/mm/flush-sh4.c:87:3: error: implicit declaration of function '__ocbi' [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[2]: *** [arch/sh/mm/flush-sh4.o] Error 1
arch/sh/mm/cache-sh4.c:70:3: error: implicit declaration of function '__ocbwb' [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[2]: *** [arch/sh/mm/cache-sh4.o] Error 1
arch/sh/kernel/cpu/fpu.c:81:2: error: 'TRAP_HANDLER_DECL' undeclared (first use in this function)
arch/sh/kernel/cpu/fpu.c:83:20: error: 'regs' undeclared (first use in this function)
arch/sh/kernel/cpu/fpu.c:83:19: error: called object 'fpu_state_restore' is not a function
make[3]: *** [arch/sh/kernel/cpu/fpu.o] Error 1
arch/sh/kernel/cpu/sh4/fpu.c:407:2: error: 'TRAP_HANDLER_DECL' undeclared (first use in this function)
arch/sh/kernel/cpu/sh4/fpu.c:409:20: error: 'regs' undeclared (first use in this function)
make[4]: *** [arch/sh/kernel/cpu/sh4/fpu.o] Error 1

Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agoparisc: fix missing cmpxchg file error from system.h split
Paul Gortmaker [Sun, 1 Apr 2012 17:12:49 +0000 (13:12 -0400)]
parisc: fix missing cmpxchg file error from system.h split

Commit b4816afa3986704d1404fc48e931da5135820472

    "Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h"

introduced the concept of asm/cmpxchg.h but the parisc arch
never got one.  Fork the cmpxchg content out of the asm/atomic.h
file to create one.

Some minor whitespace fixups were done on the block of code that
created the new file.

Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12 years agocgroup: make css->refcnt clearing on cgroup removal optional
Tejun Heo [Sun, 1 Apr 2012 19:09:56 +0000 (12:09 -0700)]
cgroup: make css->refcnt clearing on cgroup removal optional

Currently, cgroup removal tries to drain all css references.  If there
are active css references, the removal logic waits and retries
->pre_detroy() until either all refs drop to zero or removal is
cancelled.

This semantics is unusual and adds non-trivial complexity to cgroup
core and IMHO is fundamentally misguided in that it couples internal
implementation details (references to internal data structure) with
externally visible operation (rmdir).  To userland, this is a behavior
peculiarity which is unnecessary and difficult to expect (css refs is
otherwise invisible from userland), and, to policy implementations,
this is an unnecessary restriction (e.g. blkcg wants to hold css refs
for caching purposes but can't as that becomes visible as rmdir hang).

Unfortunately, memcg currently depends on ->pre_destroy() retrials and
cgroup removal vetoing and can't be immmediately switched to the new
behavior.  This patch introduces the new behavior of not waiting for
css refs to drain and maintains the old behavior for subsystems which
have __DEPRECATED_clear_css_refs set.

Once, memcg is updated, we can drop the code paths for the old
behavior as proposed in the following patch.  Note that the following
patch is incorrect in that dput work item is in cgroup and may lose
some of dputs when multiples css's are released back-to-back, and
__css_put() triggers check_for_release() when refcnt reaches 0 instead
of 1; however, it shows what part can be removed.

  http://thread.gmane.org/gmane.linux.kernel.containers/22559/focus=75251

Note that, in not-too-distant future, cgroup core will start emitting
warning messages for subsys which require the old behavior, so please
get moving.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
12 years agocgroup: use negative bias on css->refcnt to block css_tryget()
Tejun Heo [Sun, 1 Apr 2012 19:09:56 +0000 (12:09 -0700)]
cgroup: use negative bias on css->refcnt to block css_tryget()

When a cgroup is about to be removed, cgroup_clear_css_refs() is
called to check and ensure that there are no active css references.

This is currently achieved by dropping the refcnt to zero iff it has
only the base ref.  If all css refs could be dropped to zero, ref
clearing is successful and CSS_REMOVED is set on all css.  If not, the
base ref is restored.  While css ref is zero w/o CSS_REMOVED set, any
css_tryget() attempt on it busy loops so that they are atomic
w.r.t. the whole css ref clearing.

This does work but dropping and re-instating the base ref is somewhat
hairy and makes it difficult to add more logic to the put path as
there are two of them - the regular css_put() and the reversible base
ref clearing.

This patch updates css ref clearing such that blocking new
css_tryget() and putting the base ref are separate operations.
CSS_DEACT_BIAS, defined as INT_MIN, is added to css->refcnt and
css_tryget() busy loops while refcnt is negative.  After all css refs
are deactivated, if they were all one, ref clearing succeeded and
CSS_REMOVED is set and the base ref is put using the regular
css_put(); otherwise, CSS_DEACT_BIAS is subtracted from the refcnts
and the original postive values are restored.

css_refcnt() accessor which always returns the unbiased positive
reference counts is added and used to simplify refcnt usages.  While
at it, relocate and reformat comments in cgroup_has_css_refs().

This separates css->refcnt deactivation and putting the base ref,
which enables the next patch to make ref clearing optional.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
12 years agocgroup: implement cgroup_rm_cftypes()
Tejun Heo [Sun, 1 Apr 2012 19:09:56 +0000 (12:09 -0700)]
cgroup: implement cgroup_rm_cftypes()

Implement cgroup_rm_cftypes() which removes an array of cftypes from a
subsystem.  It can be called whether the target subsys is attached or
not.  cgroup core will remove the specified file from all existing
cgroups.

This will be used to improve sub-subsys modularity and will be helpful
for unified hierarchy.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
12 years agocgroup: introduce struct cfent
Tejun Heo [Sun, 1 Apr 2012 19:09:56 +0000 (12:09 -0700)]
cgroup: introduce struct cfent

This patch adds cfent (cgroup file entry) which is the association
between a cgroup and a file.  This is in-cgroup representation of
files under a cgroup directory.  This simplifies walking walking
cgroup files and thus cgroup_clear_directory(), which is now
implemented in two parts - cgroup_rm_file() and a loop around it.

cgroup_rm_file() will be used to implement cftype removal and cfent is
scheduled to serve cgroup specific per-file data (e.g. for sysfs-like
"sever" semantics).

v2: - cfe was freed from cgroup_rm_file() which led to use-after-free
      if the file had openers at the time of removal.  Moved to
      cgroup_diput().

    - cgroup_clear_directory() triggered WARN_ON_ONCE() if d_subdirs
      wasn't empty after removing all files.  This triggered
      spuriously if some files were open during directory clearing.
      Removed.

v3: - In cgroup_diput(), WARN_ONCE(!list_empty(&cfe->node)) could be
      spuriously triggered for root cgroups because they don't go
      through cgroup_clear_directory() on unmount.  Don't trigger WARN
      for root cgroups.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Glauber Costa <glommer@parallels.com>
12 years agocgroup: relocate __d_cgrp() and __d_cft()
Tejun Heo [Sun, 1 Apr 2012 19:09:55 +0000 (12:09 -0700)]
cgroup: relocate __d_cgrp() and __d_cft()

Move the two macros upwards as they'll be used earlier in the file.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>