pandora-kernel.git
12 years agovfs: Create __block_page_mkwrite() helper passing error values back
Jan Kara [Mon, 23 May 2011 22:23:34 +0000 (00:23 +0200)]
vfs: Create __block_page_mkwrite() helper passing error values back

Create __block_page_mkwrite() helper which does all what block_page_mkwrite()
does except that it passes back errors from __block_write_begin /
block_commit_write calls.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agofs/namespace.c: bound mount propagation fix
Roman Borisov [Wed, 25 May 2011 23:26:48 +0000 (16:26 -0700)]
fs/namespace.c: bound mount propagation fix

This issue was discovered by users of busybox.  And the bug is actual for
busybox users, I don't know how it affects others.  Apparently, mount is
called with and without MS_SILENT, and this affects mount() behaviour.
But MS_SILENT is only supposed to affect kernel logging verbosity.

The following script was run in an empty test directory:

mkdir -p mount.dir mount.shared1 mount.shared2
touch mount.dir/a mount.dir/b
mount -vv --bind         mount.shared1 mount.shared1
mount -vv --make-rshared mount.shared1
mount -vv --bind         mount.shared2 mount.shared2
mount -vv --make-rshared mount.shared2
mount -vv --bind mount.shared2 mount.shared1
mount -vv --bind mount.dir     mount.shared2
ls -R mount.dir mount.shared1 mount.shared2
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
rm -f mount.dir/a mount.dir/b mount.dir/c
rmdir mount.dir mount.shared1 mount.shared2

mount -vv was used to show the mount() call arguments and result.
Output shows that flag argument has 0x00008000 = MS_SILENT bit:

mount: mount('mount.shared1','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared1','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared2','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared2','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('mount.dir','mount.shared2','(null)',0x00009000,'(null)'):0
mount.dir:
a
b

mount.shared1:

mount.shared2:
a
b

After adding --loud option to remove MS_SILENT bit from just one mount cmd:

mkdir -p mount.dir mount.shared1 mount.shared2
touch mount.dir/a mount.dir/b
mount -vv --bind         mount.shared1 mount.shared1 2>&1
mount -vv --make-rshared mount.shared1               2>&1
mount -vv --bind         mount.shared2 mount.shared2 2>&1
mount -vv --loud --make-rshared mount.shared2               2>&1  # <-HERE
mount -vv --bind mount.shared2 mount.shared1         2>&1
mount -vv --bind mount.dir     mount.shared2         2>&1
ls -R mount.dir mount.shared1 mount.shared2      2>&1
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
rm -f mount.dir/a mount.dir/b mount.dir/c
rmdir mount.dir mount.shared1 mount.shared2

The result is different now - look closely at mount.shared1 directory listing.
Now it does show files 'a' and 'b':

mount: mount('mount.shared1','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared1','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared2','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared2','',0x00104000,''):0
mount: mount('mount.shared2','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('mount.dir','mount.shared2','(null)',0x00009000,'(null)'):0

mount.dir:
a
b

mount.shared1:
a
b

mount.shared2:
a
b

The analysis shows that MS_SILENT flag which is ON by default in any
busybox-> mount operations cames to flags_to_propagation_type function and
causes the error return while is_power_of_2 checking because the function
expects only one bit set.  This doesn't allow to do busybox->mount with
any --make-[r]shared, --make-[r]private etc options.

Moreover, the recently added flags_to_propagation_type() function doesn't
allow us to do such operations as --make-[r]private --make-[r]shared etc.
when MS_SILENT is on.  The idea or clearing the MS_SILENT flag came from
to Denys Vlasenko.

Signed-off-by: Roman Borisov <ext-roman.borisov@nokia.com>
Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: Alexander Shishkin <virtuoso@slind.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoexportfs: reallow building as a module
Jonas Gorski [Tue, 24 May 2011 18:12:08 +0000 (20:12 +0200)]
exportfs: reallow building as a module

Commit 990d6c2d7aee921e3bce22b2d6a750fd552262be ("vfs: Add name to file
handle conversion support") changed EXPORTFS to be a bool.
This was needed for earlier revisions of the original patch, but the actual
commit put the code needing it into its own file that only gets compiled
when FHANDLE is selected which in turn selects EXPORTFS.
So EXPORTFS can be safely compiled as a module when not selecting FHANDLE.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agomerge handle_reval_dot and nameidata_drop_rcu_last
Al Viro [Fri, 25 Mar 2011 15:00:12 +0000 (11:00 -0400)]
merge handle_reval_dot and nameidata_drop_rcu_last

new helper: complete_walk().  Done on successful completion
of walk, drops out of RCU mode, does d_revalidate of final
result if that hadn't been done already.

handle_reval_dot() and nameidata_drop_rcu_last() subsumed into
that one; callers converted to use of complete_walk().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoconsolidate nameidata_..._drop_rcu()
Al Viro [Fri, 25 Mar 2011 14:32:48 +0000 (10:32 -0400)]
consolidate nameidata_..._drop_rcu()

Merge these into a single function (unlazy_walk(nd, dentry)),
kill ..._maybe variants

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agopowerpc/4xx: Adding PCIe MSI support
Rupjyoti Sarmah [Tue, 29 Mar 2011 23:10:24 +0000 (23:10 +0000)]
powerpc/4xx: Adding PCIe MSI support

This patch adds MSI support for 440SPe, 460Ex, 460Sx and 405Ex.

Signed-off-by: Rupjyoti Sarmah <rsarmah@apm.com>
Signed-off-by: Tirumala R Marri <tmarri@apm.com>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agoMerge branch 'move_extents' of git://oss.oracle.com/git/tye/linux-2.6 into ocfs2...
Joel Becker [Thu, 26 May 2011 04:51:55 +0000 (21:51 -0700)]
Merge branch 'move_extents' of git://oss.oracle.com/git/tye/linux-2.6 into ocfs2-merge-window

Conflicts:
fs/ocfs2/ioctl.c

12 years agoOcfs2: Teach local-mounted ocfs2 to handle unwritten_extents correctly.
Tristan Ye [Mon, 23 May 2011 07:57:26 +0000 (15:57 +0800)]
Ocfs2: Teach local-mounted ocfs2 to handle unwritten_extents correctly.

Oops, local-mounted of 'ocfs2_fops_no_plocks' is just missing the support
of unwritten_extents/punching-hole due to no func pointer was given correctly
to '.follocate' field.

Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
12 years agoocfs2/dlm: Do not migrate resource to a node that is leaving the domain
Sunil Mushran [Thu, 19 May 2011 21:34:12 +0000 (14:34 -0700)]
ocfs2/dlm: Do not migrate resource to a node that is leaving the domain

During dlm domain shutdown, o2dlm has to free all the lock resources. Ones that
have no locks and references are freed. Ones that have locks and/or references
are migrated to another node.

The first task in migration is finding a target. Currently we scan the lock
resource and find one node that either has a lock or a reference. This is not
very efficient in a parallel umount case as we might end up migrating the
lock resource to a node which itself may have to migrate it to a third node.

The patch scans the dlm->exit_domain_map to ensure the target node is not
leaving the domain. If no valid target node is found, o2dlm does not migrate
the resource but instead waits for the unlock and deref messages that will
allow it to free the resource.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
12 years agoocfs2/dlm: Add new dlm message DLM_BEGIN_EXIT_DOMAIN_MSG
Sunil Mushran [Thu, 19 May 2011 21:34:11 +0000 (14:34 -0700)]
ocfs2/dlm: Add new dlm message DLM_BEGIN_EXIT_DOMAIN_MSG

This patch adds a new dlm message DLM_BEGIN_EXIT_DOMAIN_MSG and ups the dlm
protocol to 1.2.

o2dlm sends this new message in dlm_unregister_domain() to mark the beginning
of the exit domain. This message is sent to all nodes in the domain.

Currently o2dlm has no way of informing other nodes of its impending exit.
This information is useful as the other nodes could disregard the exiting
node in certain operations. For example, in resource migration. If two or
more nodes were umounting in parallel, it would be more efficient if o2dlm
were to choose a non-exiting node to be the new master node rather than an
exiting one.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
12 years agopowerpc: Fix irq_free_virt by adjusting bounds before loop
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc: Fix irq_free_virt by adjusting bounds before loop

Instead of looping over each irq and checking against the irq array
bounds, adjust the bounds before looping.

The old code will not free any irq if the irq + count is above
irq_virq_count because the test in the loop is testing irq + count
instead of irq + i.

This code checks the limits to avoid unsigned integer overflows.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/irq: Protect irq_radix_revmap_lookup against irq_free_virt
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc/irq: Protect irq_radix_revmap_lookup against irq_free_virt

The radix-tree code uses call_rcu when freeing internal elements.
We must protect against the elements being freed while we traverse
the tree, even if the returned pointer will still be valid.

While preparing a patch to expand the context in which
irq_radix_revmap_lookup will be called, I realized that the
radix tree was not locked.

When asked

    For a normal call_rcu usage, is it allowed to read the structure in
    irq_enter / irq_exit, without additional rcu_read_lock?  Could an
    element freed with call_rcu advance with the cpu still between
    irq_enter/irq_exit (and irq_disabled())?

Paul McKenney replied:

    Absolutely illegal to do so. OK for call_rcu_sched(), but a
    flaming bug for call_rcu().

    And thank you very much for finding this!!!

Further analysis:

In the current CONFIG_TREE_RCU implementation. CONFIG_TREE_PREEMPT_RCU
(and CONFIG_TINY_PREEMPT_RCU) uses explicit counters.

These counters are reflected from per-CPU to global in the
scheduling-clock-interrupt handler, so disabling irq does prevent the
grace period from completing. But there are real-time implementations
(such as the one use by the Concurrent guys) where disabling irq
does -not- prevent the grace period from completing.

While an alternative fix would be to switch radix-tree to rcu_sched, I
don't want to audit the other users of radix trees (nor put alternative
freeing in the library).  The normal overhead for rcu_read_lock and
unlock are a local counter increment and decrement.

This does not show up in the rcu lockdep because in 2.6.34 commit
2676a58c98 (radix-tree: Disable RCU lockdep checking in radix tree)
deemed it too hard to pass the condition of the protecting lock
to the library.

Signed-off-by: Milton Miller <miltonm@bga.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/irq: Check desc in handle_one_irq and expand generic_handle_irq
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc/irq: Check desc in handle_one_irq and expand generic_handle_irq

Look up the descriptor and check that it is found in handle_one_irq
before checking if we are on the irq stack, and call the handler
directly using the descriptor if we are on the stack.

We need check irq_to_desc finds the descriptor to avoid a NULL
pointer dereference.  It could have failed because the number from
ppc_md.get_irq was above NR_IRQS, or various exceptional conditions
with sparse irqs (eg race conditions while freeing an irq if its was
not shutdown in the controller).

fe12bc2c99 (genirq: Uninline and sanity check generic_handle_irq())
moved generic_handle_irq out of line to allow its use by interrupt
controllers in modules.  However, handle_one_irq is core arch code.
It already knows the details of struct irq_desc and handling irqs in
the nested irq case.  This will avoid the extra stack frame to return
the value we don't check.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/irq: Always free duplicate IRQ_LEGACY hosts
Milton Miller [Tue, 24 May 2011 20:34:17 +0000 (20:34 +0000)]
powerpc/irq: Always free duplicate IRQ_LEGACY hosts

Since kmem caches are allocated before init_IRQ as noted in 3af259d155
(powerpc: Radix trees are available before init_IRQ), we now call
kmalloc in all cases and can can always call kfree if we are asked
to allocate a duplicate or conflicting IRQ_HOST_MAP_LEGACY host.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/irq: Remove stale and misleading comment
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc/irq: Remove stale and misleading comment

The comment claims we will call host->ops->map() to update the flags if
we find a previously established mapping, but we never did.  We used
to call remap, but that call was removed in da05198002 (powerpc: Remove
irq_host_ops->remap hook).

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/cell: Rename ipi functions to match current abstractions
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc/cell: Rename ipi functions to match current abstractions

Rename functions and arguments to reflect current usage.  iic_cause_ipi
becomes iic_message_pass and iic_ipi_to_irq becomes iic_msg_to_irq,
and iic_request_ipi now takes a message (msg) instead of an ipi number.
Also mesg is renamed to msg.

Commit f1072939b6 (powerpc: Remove checks for MSG_ALL and
MSG_ALL_BUT_SELF) connected the smp_message_pass hook for cell to the
underlying iic_cause_IPI, a platform unique name.  Later 23d72bfd8f
(powerpc: Consolidate ipi message mux and demux) added a cause_ipi
hook to the smp_ops, also used in message passing, but for controllers
that can not send 4 unique messages and require multiplexing.  It is
even more confusing that the both take two arguments, but one is the
small message ordinal and the other is an opaque long data associated
with the cpu.

Since cell iic maps messages one to one to ipi irqs, rename the
function and argument to translate from ipi to message.  Also make it
clear that iic_request_ipi takes a message number as the argument
for which ipi to create and request.

No functionional change, just renames to avoid future confusion.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/cell: Use common smp ipi actions
Milton Miller [Tue, 24 May 2011 20:34:18 +0000 (20:34 +0000)]
powerpc/cell: Use common smp ipi actions

The cell iic interrupt controller has enough software caused interrupts
to use a unique interrupt for each of the 4 messages powerpc uses.
This means each interrupt gets its own irq action/data combination.

Use the seperate, optimized, arch common ipi action functions
registered via the helper smp_request_message_ipi instead passing the
message as action data to a single action that then demultipexes to
the required acton via a switch statement.

smp_request_message_ipi will register the action as IRQF_PER_CPU
and IRQF_DISABLED, and WARN if the allocation fails for some reason,
so no need to print on that failure.  It will return positive if
the message will not be used by the kernel, in which case we can
free the virq.

In addition to elimiating inefficient code, this also corrects the
error that a kernel built with kexec but without a debugger would
not register the ipi for kdump to notify the other cpus of a crash.

This also restores the debugger action to be static to kernel/smp.c.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agoRemove unused MSG_ flags in linux/smp.h
Milton Miller [Tue, 10 May 2011 19:29:13 +0000 (19:29 +0000)]
Remove unused MSG_ flags in linux/smp.h

Now that powerpc has removed its use of MSG_ALL_BUT_SELF and MSG_ALL
all these MSG_ flags are unused.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/pseries: Update MAX_HCALL_OPCODE to reflect page coalescing
Brian King [Tue, 24 May 2011 03:40:54 +0000 (03:40 +0000)]
powerpc/pseries: Update MAX_HCALL_OPCODE to reflect page coalescing

When page coalescing support was added recently, the MAX_HCALL_OPCODE
define was not updated for the newly added H_GET_MPP_X hcall.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/oprofile: Handle events that raise an exception without overflowing
Eric B Munson [Mon, 23 May 2011 04:22:40 +0000 (04:22 +0000)]
powerpc/oprofile: Handle events that raise an exception without overflowing

Commit 0837e3242c73566fc1c0196b4ec61779c25ffc93 fixes a situation on POWER7
where events can roll back if a specualtive event doesn't actually complete.
This can raise a performance monitor exception.  We need to catch this to ensure
that we reset the PMC.  In all cases the PMC will be less than 256 cycles from
overflow.

This patch lifts Anton's fix for the problem in perf and applies it to oprofile
as well.

Signed-off-by: Eric B Munson <emunson@mgebm.net>
Cc: <stable@kernel.org> # as far back as it applies cleanly
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/ftrace: Implement raw syscall tracepoints on PowerPC
Ian Munsie [Wed, 2 Feb 2011 17:27:24 +0000 (17:27 +0000)]
powerpc/ftrace: Implement raw syscall tracepoints on PowerPC

This patch implements the raw syscall tracepoints on PowerPC and exports
them for ftrace syscalls to use.

To minimise reworking existing code, I slightly re-ordered the thread
info flags such that the new TIF_SYSCALL_TRACEPOINT bit would still fit
within the 16 bits of the andi. instruction's UI field. The instructions
in question are in /arch/powerpc/kernel/entry_{32,64}.S to and the
_TIF_SYSCALL_T_OR_A with the thread flags to see if system call tracing
is enabled.

In the case of 64bit PowerPC, arch_syscall_addr and
arch_syscall_match_sym_name are overridden to allow ftrace syscalls to
work given the unusual system call table structure and symbol names that
start with a period.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agotmpfs: fix XATTR N overriding POSIX_ACL Y
Eric Paris [Thu, 26 May 2011 02:49:18 +0000 (19:49 -0700)]
tmpfs: fix XATTR N overriding POSIX_ACL Y

Choosing TMPFS_XATTR default N was switching off TMPFS_POSIX_ACL,
even if it had been Y in oldconfig; and Linus reports that PulseAudio
goes subtly wrong unless it can use ACLs on /dev/shm.

Make TMPFS_POSIX_ACL select TMPFS_XATTR (and depend upon TMPFS),
and move the TMPFS_POSIX_ACL entry before the TMPFS_XATTR entry,
to avoid asking unnecessary questions then ignoring their answers.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agovideo: mb862xx: udelay need linux/delay.h
Stephen Rothwell [Thu, 26 May 2011 01:09:10 +0000 (11:09 +1000)]
video: mb862xx: udelay need linux/delay.h

Fix this:

  drivers/video/mb862xx/mb862xx-i2c.c: In function 'mb862xx_i2c_wait_event':
  drivers/video/mb862xx/mb862xx-i2c.c:25: error: implicit declaration of function 'udelay'

caused by commit f8a6b1f44833 ("video: mb862xx: add support for
controller's I2C bus adapter").

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd
Linus Torvalds [Thu, 26 May 2011 01:10:16 +0000 (18:10 -0700)]
Merge git://git./linux/kernel/git/ebiederm/linux-2.6-nsfd

* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd:
  net: fix get_net_ns_by_fd for !CONFIG_NET_NS
  ns proc: Return -ENOENT for a nonexistent /proc/self/ns/ entry.
  ns: Declare sys_setns in syscalls.h
  net: Allow setting the network namespace by fd
  ns proc: Add support for the ipc namespace
  ns proc: Add support for the uts namespace
  ns proc: Add support for the network namespace.
  ns: Introduce the setns syscall
  ns: proc files for namespace naming policy.

12 years agoslub: remove no-longer used 'unlock_out' label
Linus Torvalds [Thu, 26 May 2011 01:06:54 +0000 (18:06 -0700)]
slub: remove no-longer used 'unlock_out' label

Commit a71ae47a2cbf ("slub: Fix double bit unlock in debug mode")
removed the only goto to this label, resulting in

  mm/slub.c: In function '__slab_alloc':
  mm/slub.c:1834: warning: label 'unlock_out' defined but not used

fixed trivially by the removal of the label itself too.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 26 May 2011 00:00:17 +0000 (17:00 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (89 commits)
  bonding: documentation and code cleanup for resend_igmp
  bonding: prevent deadlock on slave store with alb mode (v3)
  net: hold rtnl again in dump callbacks
  Add Fujitsu 1000base-SX PCI ID to tg3
  bnx2x: protect sequence increment with mutex
  sch_sfq: fix peek() implementation
  isdn: netjet - blacklist Digium TDM400P
  via-velocity: don't annotate MAC registers as packed
  xen: netfront: hold RTNL when updating features.
  sctp: fix memory leak of the ASCONF queue when free asoc
  net: make dev_disable_lro use physical device if passed a vlan dev (v2)
  net: move is_vlan_dev into public header file (v2)
  bug.h: Fix build with CONFIG_PRINTK disabled.
  wireless: fix fatal kernel-doc error + warning in mac80211.h
  wireless: fix cfg80211.h new kernel-doc warnings
  iwlagn: dbg_fixed_rate only used when CONFIG_MAC80211_DEBUGFS enabled
  dst: catch uninitialized metrics
  be2net: hash key for rss-config cmd not set
  bridge: initialize fake_rtable metrics
  net: fix __dst_destroy_metrics_generic()
  ...

Fix up trivial conflicts in drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Linus Torvalds [Wed, 25 May 2011 23:55:55 +0000 (16:55 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (75 commits)
  mmc: core: eMMC bus width may not work on all platforms
  mmc: sdhci: Auto-CMD23 fixes.
  mmc: sdhci: Auto-CMD23 support.
  mmc: core: Block CMD23 support for UHS104/SDXC cards.
  mmc: sdhci: Implement MMC_CAP_CMD23 for SDHCI.
  mmc: core: Use CMD23 for multiblock transfers when we can.
  mmc: quirks: Add/remove quirks conditional support.
  mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver
  mmc: sdhci-pxa: Add quirks for DMA/ADMA to match h/w
  mmc: core: duplicated trial with same freq in mmc_rescan_try_freq()
  mmc: core: add support for eMMC Dual Data Rate
  mmc: core: eMMC signal voltage does not use CMD11
  mmc: sdhci-pxa: add platform code for UHS signaling
  mmc: sdhci: add hooks for setting UHS in platform specific code
  mmc: core: clear MMC_PM_KEEP_POWER flag on resume
  mmc: dw_mmc: fixed wrong regulator_enable in suspend/resume
  mmc: sdhi: allow powering down controller with no card inserted
  mmc: tmio: runtime suspend the controller, where possible
  mmc: sdhi: support up to 3 interrupt sources
  mmc: sdhi: print physical base address and clock rate
  ...

12 years agoMerge branch 'kconfig-for-40' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek...
Linus Torvalds [Wed, 25 May 2011 23:54:01 +0000 (16:54 -0700)]
Merge branch 'kconfig-for-40' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'kconfig-for-40' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  xconfig: merge code path to conf_write()
  kconfig: do not record timestamp in .config
  gconfig: Hide unused left treeview when start up the interface
  gconfig: enable rules hint for main treeviews
  MAINTAINERS: Update KCONFIG entry
  kconfig-language: add to hints
  kconfig: Document the new "visible if" syntax
  kconfig: quiet commands when V=0
  kconfig: change update-po-config to reflect new layout of arch/um
  kconfig: make update-po-config work in KBUILD_OUTPUT
  kconfig: rearrange clean-files
  kconfig: change gconf to modify hostprogs-y like nconf and mconf
  kconfig: change qconf to modify hostprogs-y like nconf and mconf
  kconfig: only build kxgettext when needed
  nconfig: Silence unused return values from wattrset
  kconfig: Do not record timestamp in auto.conf and autoconf.h
  kconfig: get rid of unused flags
  kconfig: allow multiple inclusion of the same file
  kconfig: Avoid buffer underrun in choice input

12 years agoMerge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc
Linus Torvalds [Wed, 25 May 2011 23:53:14 +0000 (16:53 -0700)]
Merge branch 'for-2.6.40' of git://git./linux/kernel/git/oleg/misc

* 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc:
  signal: sys_pause() should check signal_pending()
  ptrace: ptrace_resume() shouldn't wake up !TASK_TRACED thread

12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Wed, 25 May 2011 23:52:50 +0000 (16:52 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: New driver for the SMSC EMC6W201
  hwmon: (abituguru) Depend on DMI
  hwmon: (it87) Use request_muxed_region
  hwmon: (sch5627) Trigger Vbat measurements
  hwmon: (sch5627) Add sch5627_send_cmd function
  i8k: Integrate with the hwmon subsystem
  hwmon: (max6650) Properly support the MAX6650
  hwmon: (max6650) Drop device detection
  Move ACPI power meter driver to hwmon
  hwmon: (f71882fg) Add support for F71808A
  hwmon: (f71882fg) Split has_beep in fan_has_beep and temp_has_beep
  hwmon: (asc7621) Drop duplicate dependency
  hwmon: (jc42) Change detection class
  hwmon: Add driver for AMD family 15h processor power information
  hwmon: (k10temp) Add support for Fam15h (Bulldozer)
  hwmon: Use helper functions to set and get driver data
  i8k: Avoid lahf in 64-bit code

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Linus Torvalds [Wed, 25 May 2011 22:35:32 +0000 (15:35 -0700)]
Merge git://git./linux/kernel/git/cmetcalf/linux-tile

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (26 commits)
  arch/tile: prefer "tilepro" as the name of the 32-bit architecture
  compat: include aio_abi.h for aio_context_t
  arch/tile: cleanups for tilegx compat mode
  arch/tile: allocate PCI IRQs later in boot
  arch/tile: support signal "exception-trace" hook
  arch/tile: use better definitions of xchg() and cmpxchg()
  include/linux/compat.h: coding-style fixes
  tile: add an RTC driver for the Tilera hypervisor
  arch/tile: finish enabling support for TILE-Gx 64-bit chip
  compat: fixes to allow working with tile arch
  arch/tile: update defconfig file to something more useful
  tile: do_hardwall_trap: do not play with task->sighand
  tile: replace mm->cpu_vm_mask with mm_cpumask()
  tile,mn10300: add device parameter to dma_cache_sync()
  audit: support the "standard" <asm-generic/unistd.h>
  arch/tile: clarify flush_buffer()/finv_buffer() function names
  arch/tile: kernel-related cleanups from removing static page size
  arch/tile: various header improvements for building drivers
  arch/tile: disable GX prefetcher during cache flush
  arch/tile: tolerate disabling CONFIG_BLK_DEV_INITRD
  ...

12 years agoMerge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Wed, 25 May 2011 22:35:03 +0000 (15:35 -0700)]
Merge branch 'for-torvalds' of git://git./linux/kernel/git/linusw/linux-stericsson

* 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
  mach-ux500: voltage domain regulators for DB8500
  cpufreq: make DB8500 cpufreq driver compile
  cpufreq: update DB8500 cpufreq driver
  mach-ux500: move CPUfreq driver to cpufreq subsystem
  mfd: add DB5500 PRCMU driver
  mfd: update DB8500 PRCMU driver
  mach-ux500: move the DB8500 PRCMU driver to MFD
  mach-ux500: make PRCMU base address dynamic
  mach-ux500: rename PRCMU driver per SoC
  mach-ux500: update ASIC version detection
  mach-ux500: update SoC and board IRQ handling
  mach-ux500: update the DB5500 register file
  mach-ux500: update the DB8500 register file

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier...
Linus Torvalds [Wed, 25 May 2011 22:34:14 +0000 (15:34 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/vapier/blackfin

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (37 commits)
  Blackfin: use new common PERCPU_INPUT define
  MAINTAINERS: Fix Analog Devices mailinglist address
  Blackfin: boards: update ASoC resources after machine driver overhaul
  Blackfin: work around anomaly 05000480
  Blackfin: fix addr type with bfin_write_{or,and} helpers
  Blackfin: convert /proc/sram to seq_file
  Blackfin: switch /proc/gpio to seq_file
  Blackfin: fix indentation with bfin_read() helper
  Blackfin: convert old cpumask API to new one
  Blackfin: don't touch task->cpus_allowed directly
  Blackfin: don't touch cpu_possible_map and cpu_present_map directly
  Blackfin: bf548-ezkit/bf561-ezkit: update nor flash layout
  Blackfin: initial perf_event support
  Blackfin: update anomaly lists to latest public info
  Blackfin: use on-chip reset func with newer parts
  Blackfin: bf533-stamp/bf537-stamp: drop ad1980 from defconfigs
  Blackfin: optimize MMR reads during startup a bit
  Blackfin: bf537: demux port H mask A and emac rx ints
  Blackfin: bf537: fix excessive gpio int demuxing
  Blackfin: bf54x: drop unused pm gpio handling
  ...

12 years agoMerge branch 'rmobile-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Wed, 25 May 2011 22:33:25 +0000 (15:33 -0700)]
Merge branch 'rmobile-latest' of git://git./linux/kernel/git/lethal/sh-2.6

* 'rmobile-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (34 commits)
  ARM: mach-shmobile: mackerel: add renesas_usbhs support for USB1
  ARM: mach-shmobile: Correct the G4EVM SDHI0 I/O range.
  ARM: arch-shmobile: sh7372: add renesas_usbhs irq support
  ARM: mach-shmobile: sh73a0: mark DMA slave ID 0 as invalid
  ARM: mach-shmobile: mark DMA slave ID 0 as invalid
  ARM: mach-shmobile: Enable DMAEngine for SDHI on AG5EVM
  ARM: mach-shmobile: Enable DMAEngine for MMCIF on AG5EVM
  ARM: mach-shmobile: sh73a0 DMA Engine support for SY-DMAC
  dmaengine: shdma: Update SH_DMAC_MAX_CHANNELS to 20
  dmaengine: shdma: Fix SH_DMAC_MAX_CHANNELS handling
  dmaengine: shdma: Make second memory window optional
  ARM: mach-shmobile: Tidy up after SH7372 pm changes.
  ARM: mach-shmobile: sh7372 Core Standby CPUIdle
  ARM: mach-shmobile: CPUIdle support
  ARM: mach-shmobile: sh7372 Core Standby Suspend-to-RAM
  ARM: mach-shmobile: Suspend-to-RAM support
  mailmap: Add entry for Damian Hobson-Garcia.
  ARM: switch mackerel to dynamically manage the platform camera
  ARM: mach-shmobile: Add SDHI support for AG5EVM and sh73a0
  ARM: arch-shmobile: Use multiple irq vectors for SDHI
  ...

12 years agohrtimers: Fix typo causing erratic timers
Thomas Gleixner [Wed, 25 May 2011 21:08:17 +0000 (23:08 +0200)]
hrtimers: Fix typo causing erratic timers

commit 9ec2690758a5 ("timerfd: Manage cancelable timers in timerfd")
introduced a CONFIG_HIGHRES_TIMERS (should be CONFIG_HIGH_RES_TIMERS)
typo, which caused applications depending on CLOCK_REALTIME timers to
become sluggy due to the fact that the time base of the realtime
timers was not updated when the wall clock time was set.

This causes anything from 100% CPU use for some applications to odd
delays and hickups.

Reported-bisected-and-tested-by: Anca Emanuel <anca.emanuel@gmail.com>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Fatfingered-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agobonding: documentation and code cleanup for resend_igmp
Flavio Leitner [Wed, 25 May 2011 08:38:58 +0000 (08:38 +0000)]
bonding: documentation and code cleanup for resend_igmp

Improves the documentation about how IGMP resend parameter
works, fix two missing checks and coding style issues.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobonding: prevent deadlock on slave store with alb mode (v3)
Neil Horman [Wed, 25 May 2011 08:13:01 +0000 (08:13 +0000)]
bonding: prevent deadlock on slave store with alb mode (v3)

This soft lockup was recently reported:

[root@dell-per715-01 ~]# echo +bond5 > /sys/class/net/bonding_masters
[root@dell-per715-01 ~]# echo +eth1 > /sys/class/net/bond5/bonding/slaves
bonding: bond5: doing slave updates when interface is down.
bonding bond5: master_dev is not up in bond_enslave
[root@dell-per715-01 ~]# echo -eth1 > /sys/class/net/bond5/bonding/slaves
bonding: bond5: doing slave updates when interface is down.

BUG: soft lockup - CPU#12 stuck for 60s! [bash:6444]
CPU 12:
Modules linked in: bonding autofs4 hidp rfcomm l2cap bluetooth lockd sunrpc
be2d
Pid: 6444, comm: bash Not tainted 2.6.18-262.el5 #1
RIP: 0010:[<ffffffff80064bf0>]  [<ffffffff80064bf0>]
.text.lock.spinlock+0x26/00
RSP: 0018:ffff810113167da8  EFLAGS: 00000286
RAX: ffff810113167fd8 RBX: ffff810123a47800 RCX: 0000000000ff1025
RDX: 0000000000000000 RSI: ffff810123a47800 RDI: ffff81021b57f6f8
RBP: ffff81021b57f500 R08: 0000000000000000 R09: 000000000000000c
R10: 00000000ffffffff R11: ffff81011d41c000 R12: ffff81021b57f000
R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000282
FS:  00002b3b41ef3f50(0000) GS:ffff810123b27940(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00002b3b456dd000 CR3: 000000031fc60000 CR4: 00000000000006e0

Call Trace:
 [<ffffffff80064af9>] _spin_lock_bh+0x9/0x14
 [<ffffffff886937d7>] :bonding:tlb_clear_slave+0x22/0xa1
 [<ffffffff8869423c>] :bonding:bond_alb_deinit_slave+0xba/0xf0
 [<ffffffff8868dda6>] :bonding:bond_release+0x1b4/0x450
 [<ffffffff8006457b>] __down_write_nested+0x12/0x92
 [<ffffffff88696ae4>] :bonding:bonding_store_slaves+0x25c/0x2f7
 [<ffffffff801106f7>] sysfs_write_file+0xb9/0xe8
 [<ffffffff80016b87>] vfs_write+0xce/0x174
 [<ffffffff80017450>] sys_write+0x45/0x6e
 [<ffffffff8005d28d>] tracesys+0xd5/0xe0

It occurs because we are able to change the slave configuarion of a bond while
the bond interface is down.  The bonding driver initializes some data structures
only after its ndo_open routine is called.  Among them is the initalization of
the alb tx and rx hash locks.  So if we add or remove a slave without first
opening the bond master device, we run the risk of trying to lock/unlock a
spinlock that has garbage for data in it, which results in our above softlock.

Note that sometimes this works, because in many cases an unlocked spinlock has
the raw_lock parameter initialized to zero (meaning that the kzalloc of the
net_device private data is equivalent to calling spin_lock_init), but thats not
true in all cases, and we aren't guaranteed that condition, so we need to pass
the relevant spinlocks through the spin_lock_init function.

Fix it by moving the spin_lock_init calls for the tx and rx hashtable locks to
the ndo_init path, so they are ready for use by the bond_store_slaves path.

Change notes:
v2) Based on conversation with Jay and Nicolas it seems that the ability to
enslave devices while the bond master is down should be safe to do.  As such
this is an outlier bug, and so instead we'll just initalize the errant spinlocks
in the init path rather than the open path, solving the problem.  We'll also
remove the warnings about the bond being down during enslave operations, since
it should be safe

v3) Fix spelling error

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: jtluka@redhat.com
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: nicolas.2p.debian@gmail.com
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: hold rtnl again in dump callbacks
Eric Dumazet [Wed, 25 May 2011 07:34:04 +0000 (07:34 +0000)]
net: hold rtnl again in dump callbacks

Commit e67f88dd12f6 (dont hold rtnl mutex during netlink dump callbacks)
missed fact that rtnl_fill_ifinfo() must be called with rtnl held.

Because of possible deadlocks between two mutexes (cb_mutex and rtnl),
its not easy to solve this problem, so revert this part of the patch.

It also forgot one rcu_read_unlock() in FIB dump_rules()

Add one ASSERT_RTNL() in rtnl_fill_ifinfo() to remind us the rule.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoAdd Fujitsu 1000base-SX PCI ID to tg3
Meelis Roos [Wed, 25 May 2011 05:43:47 +0000 (05:43 +0000)]
Add Fujitsu 1000base-SX PCI ID to tg3

This patch adds the PCI ID of Fujitsu 1000base-SX NIC to tg3 driver.
Tested to detect the card, MAC and serdes, not tested with link at the
moment since I have no fiber switch here. I did not add new constants to
the pci_ids.h header file since these constants are used only here.

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: protect sequence increment with mutex
Dmitry Kravkov [Wed, 25 May 2011 04:55:51 +0000 (04:55 +0000)]
bnx2x: protect sequence increment with mutex

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosch_sfq: fix peek() implementation
Eric Dumazet [Wed, 25 May 2011 04:40:11 +0000 (04:40 +0000)]
sch_sfq: fix peek() implementation

Since commit eeaeb068f139 (sch_sfq: allow big packets and be fair),
sfq_peek() can return a different skb that would be normally dequeued by
sfq_dequeue() [ if current slot->allot is negative ]

Use generic qdisc_peek_dequeued() instead of custom implementation, to
get consistent result.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Jesper Dangaard Brouer <hawk@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoisdn: netjet - blacklist Digium TDM400P
Prarit Bhargava [Wed, 25 May 2011 02:12:23 +0000 (02:12 +0000)]
isdn: netjet - blacklist Digium TDM400P

[2nd try ... 1st attempt didn't make it to netdev mailing list]

A quick google search reveals that people with this card are blacklisting it
in the initramfs and in the module blacklist based on a statement that it
is unsupported. Since the older Digium is also unsupported I'm pretty
confident that this newer card is also not supported.

lspci -xxx -vv shows

04:07.0 Communication controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface
        Subsystem: Device b100:0003
P.

----8<----
The Asterisk Voice Card, DIGIUM TDM400P is unsupported by the netjet driver.
Blacklist it like the Digium X100P/X101P card.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agovia-velocity: don't annotate MAC registers as packed
Ulrich Hecht [Wed, 25 May 2011 01:07:22 +0000 (01:07 +0000)]
via-velocity: don't annotate MAC registers as packed

On ARM, memory accesses through packed pointers behave in unexpected
ways in GCC releases 4.3 and higher; see https://lkml.org/lkml/2011/2/2/163
for discussion.

In this particular case, 32-bit I/O registers are accessed bytewise,
causing incorrect setting of the DMA address registers which in turn
leads to an error interrupt storm that brings the system to a halt.

Since the mac_regs structure does not need any packing anyway, this patch
simply removes the attribute to fix the issue.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoxen: netfront: hold RTNL when updating features.
Ian Campbell [Tue, 24 May 2011 21:56:02 +0000 (21:56 +0000)]
xen: netfront: hold RTNL when updating features.

Konrad reports:
[    0.930811] RTNL: assertion failed at /home/konrad/ssd/linux/net/core/dev.c (5258)
[    0.930821] Pid: 22, comm: xenwatch Not tainted 2.6.39-05193-gd762f43 #1
[    0.930825] Call Trace:
[    0.930834]  [<ffffffff8143bd0e>] __netdev_update_features+0xae/0xe0
[    0.930840]  [<ffffffff8143dd41>] netdev_update_features+0x11/0x30
[    0.930847]  [<ffffffffa0037105>] netback_changed+0x4e5/0x800 [xen_netfront]
[    0.930854]  [<ffffffff8132a838>] xenbus_otherend_changed+0xa8/0xb0
[    0.930860]  [<ffffffff8157ca99>] ? _raw_spin_unlock_irqrestore+0x19/0x20
[    0.930866]  [<ffffffff8132adfe>] backend_changed+0xe/0x10
[    0.930871]  [<ffffffff8132875a>] xenwatch_thread+0xba/0x180
[    0.930876]  [<ffffffff810a8ba0>] ? wake_up_bit+0x40/0x40
[    0.930881]  [<ffffffff813286a0>] ? split+0xf0/0xf0
[    0.930886]  [<ffffffff810a8646>] kthread+0x96/0xa0
[    0.930891]  [<ffffffff815855a4>] kernel_thread_helper+0x4/0x10
[    0.930896]  [<ffffffff815846b3>] ? int_ret_from_sys_call+0x7/0x1b
[    0.930901]  [<ffffffff8157cf61>] ? retint_restore_args+0x5/0x6
[    0.930906]  [<ffffffff815855a0>] ? gs_change+0x13/0x13

This update happens in xenbus watch callback context and hence does not already
hold the rtnl. Take the lock as necessary.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosctp: fix memory leak of the ASCONF queue when free asoc
Wei Yongjun [Tue, 24 May 2011 21:48:02 +0000 (21:48 +0000)]
sctp: fix memory leak of the ASCONF queue when free asoc

If an ASCONF chunk is outstanding, then the following ASCONF
chunk will be queued for later transmission. But when we free
the asoc, we forget to free the ASCONF queue at the same time,
this will cause memory leak.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: make dev_disable_lro use physical device if passed a vlan dev (v2)
Neil Horman [Tue, 24 May 2011 08:31:09 +0000 (08:31 +0000)]
net: make dev_disable_lro use physical device if passed a vlan dev (v2)

If the device passed into dev_disable_lro is a vlan, then repoint the dev
poniter so that we actually modify the underlying physical device.

Signed-of-by: Neil Horman <nhorman@tuxdriver.com>
CC: davem@davemloft.net
CC: bhutchings@solarflare.com
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: move is_vlan_dev into public header file (v2)
Neil Horman [Tue, 24 May 2011 08:31:08 +0000 (08:31 +0000)]
net: move is_vlan_dev into public header file (v2)

Migrate is_vlan_dev() to if_vlan.h so that core networkig can use it

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: davem@davemloft.net
CC: bhutchings@solarflare.com
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agojbd2: fix a potential leak of a journal_head on an error path
Ding Dinghua [Wed, 25 May 2011 21:43:48 +0000 (17:43 -0400)]
jbd2: fix a potential leak of a journal_head on an error path

drop jh->b_jcount in error path

Signed-off-by: Ding Dinghua <dingdinghua@nrchpc.ac.cn>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: teach ext4_ext_split to calculate extents efficiently
Yongqiang Yang [Wed, 25 May 2011 21:41:48 +0000 (17:41 -0400)]
ext4: teach ext4_ext_split to calculate extents efficiently

Make ext4_ext_split() get extents to be moved by calculating in a statement
instead of counting in a loop.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: Convert ext4 to new truncate calling convention
Jan Kara [Wed, 25 May 2011 21:39:48 +0000 (17:39 -0400)]
ext4: Convert ext4 to new truncate calling convention

Trivial conversion.  Fixup one error handling case calling vmtruncate()
and remove ->truncate callback. We also fix a bug that IS_IMMUTABLE and
IS_APPEND files could not be truncated during failed writes. In fact, the
test can be completely removed as upper layers do necessary permission
checks for truncate in do_sys_[f]truncate() and may_open() anyway.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agommc: core: eMMC bus width may not work on all platforms
Philip Rakity [Wed, 25 May 2011 01:14:58 +0000 (18:14 -0700)]
mmc: core: eMMC bus width may not work on all platforms

CMD19 -- The offical way to validate bus widths from the JEDEC spec
does not work on all platforms.  Some platforms that use PCI/PCIe
to connect their SD controllers are known to fail.

If the quirk MMC_BUS_WIDTH_TEST is not defined we try to figure out
the bus width by reading the ext_csd at different bus widths and
compare this against the ext_csd read in 1 bit mode.  If no ext_csd
is available we default to 1 bit operations.

Code has been tested on mmp2 against 8 bit eMMC and Transcend 2GB
card that is known to not work in 4 bit mode.  The physical pins
on the card are not present to support 4 bit operation.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci: Auto-CMD23 fixes.
Andrei Warkentin [Wed, 25 May 2011 14:42:50 +0000 (10:42 -0400)]
mmc: sdhci: Auto-CMD23 fixes.

Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23
should be enabled if host is >= v3, and SDMA is not in use.

USE_ADMA | USE_SDMA | Auto-CMD23
---------+----------+-----------
    0    |    0     |     1
---------+----------+-----------
    0    |    1     |     0
---------+----------+-----------
    1    |    0     |     1
---------+----------+-----------
    1    |    1     |     1

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci: Auto-CMD23 support.
Andrei Warkentin [Mon, 23 May 2011 20:06:39 +0000 (15:06 -0500)]
mmc: sdhci: Auto-CMD23 support.

Enables Auto-CMD23 support where available (SDHCI 3.0 controllers)

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Tested-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Block CMD23 support for UHS104/SDXC cards.
Andrei Warkentin [Mon, 23 May 2011 20:06:38 +0000 (15:06 -0500)]
mmc: core: Block CMD23 support for UHS104/SDXC cards.

SD cards operating at UHS104 or better support SET_BLOCK_COUNT.

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci: Implement MMC_CAP_CMD23 for SDHCI.
Andrei Warkentin [Mon, 23 May 2011 20:06:37 +0000 (15:06 -0500)]
mmc: sdhci: Implement MMC_CAP_CMD23 for SDHCI.

Implements support for multiblock transfers bounded
by SET_BLOCK_COUNT (CMD23).

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Use CMD23 for multiblock transfers when we can.
Andrei Warkentin [Mon, 23 May 2011 20:06:36 +0000 (15:06 -0500)]
mmc: core: Use CMD23 for multiblock transfers when we can.

CMD23-prefixed instead of open-ended multiblock transfers
have a performance advantage on some MMC cards.

Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoMerge branches 'cma', 'cxgb3', 'cxgb4', 'misc', 'nes', 'netlink', 'srp' and 'uverbs...
Roland Dreier [Wed, 25 May 2011 20:47:20 +0000 (13:47 -0700)]
Merge branches 'cma', 'cxgb3', 'cxgb4', 'misc', 'nes', 'netlink', 'srp' and 'uverbs' into for-next

12 years agoRDMA/cma: Save PID of ID's owner
Nir Muchtar [Thu, 13 Jan 2011 13:56:04 +0000 (13:56 +0000)]
RDMA/cma: Save PID of ID's owner

Save the PID associated with an RDMA CM ID for reporting via netlink.

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoRDMA/cma: Add support for netlink statistics export
Nir Muchtar [Mon, 3 Jan 2011 15:33:53 +0000 (15:33 +0000)]
RDMA/cma: Add support for netlink statistics export

Add callbacks and data types for statistics export of all current
devices/ids.  The schema for RDMA CM is a series of netlink messages.
Each one contains an rdma_cm_stat struct.  Additionally, two netlink
attributes are created for the addresses for each message (if
applicable).

Their types used are:
RDMA_NL_RDMA_CM_ATTR_SRC_ADDR (The source address for this ID)
RDMA_NL_RDMA_CM_ATTR_DST_ADDR (The destination address for this ID)
sockaddr_* structs are encapsulated within these attributes.

In other words, every transaction contains a series of messages like:

-------message 1-------
struct rdma_cm_id_stats {
       __u32 qp_num;
       __u32 bound_dev_if;
       __u32 port_space;
       __s32 pid;
       __u8 cm_state;
       __u8 node_type;
       __u8 port_num;
       __u8 reserved;
}
RDMA_NL_RDMA_CM_ATTR_SRC_ADDR attribute - contains the source address
RDMA_NL_RDMA_CM_ATTR_DST_ADDR attribute - contains the destination address
-------end 1-------
-------message 2-------
struct rdma_cm_id_stats
RDMA_NL_RDMA_CM_ATTR_SRC_ADDR attribute
RDMA_NL_RDMA_CM_ATTR_DST_ADDR attribute
-------end 2-------

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoRDMA/cma: Pass QP type into rdma_create_id()
Sean Hefty [Thu, 1 Apr 2010 17:08:41 +0000 (17:08 +0000)]
RDMA/cma: Pass QP type into rdma_create_id()

The RDMA CM currently infers the QP type from the port space selected
by the user.  In the future (eg with RDMA_PS_IB or XRC), there may not
be a 1-1 correspondence between port space and QP type.  For netlink
export of RDMA CM state, we want to export the QP type to userspace,
so it is cleaner to explicitly associate a QP type to an ID.

Modify rdma_create_id() to allow the user to specify the QP type, and
use it to make our selections of datagram versus connected mode.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoRDMA: Update exported headers list
Roland Dreier [Tue, 10 May 2011 19:36:01 +0000 (12:36 -0700)]
RDMA: Update exported headers list

Various RDMA headers are intended to be exported to userspace, so add
them to the headers-y list.  Add a (strictly speaking, superfluous)
include of <linux/types.h> to avoid a headers_check warning.

Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoRDMA/cma: Export enum cma_state in <rdma/rdma_cm.h>
Nir Muchtar [Fri, 20 May 2011 18:46:11 +0000 (11:46 -0700)]
RDMA/cma: Export enum cma_state in <rdma/rdma_cm.h>

Move cma.c's internal definition of enum cma_state to enum rdma_cm_state
in an exported header so that it can be exported via RDMA netlink.

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoarch/tile: prefer "tilepro" as the name of the 32-bit architecture
Chris Metcalf [Wed, 25 May 2011 19:24:00 +0000 (15:24 -0400)]
arch/tile: prefer "tilepro" as the name of the 32-bit architecture

With this change, you can (and should) build with ARCH=tilepro for the
current 32-bit chips.  Building with ARCH=tile continues to work, but
we've renamed the defconfig file to tilepro_defconfig for consistency.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
12 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
Linus Torvalds [Wed, 25 May 2011 19:04:15 +0000 (12:04 -0700)]
Merge branch 'misc' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  export_report: use warn() to issue WARNING, so they go to stderr
  export_report: sort SECTION 2 output
  export_report: do collectcfiles work in perl itself
  kbuild: make versioncheck work in KBUILD_OUTDIR
  kbuild: make includecheck work in KBUILD_OUTDIR
  kbuild: make headerdep work in KBUILD_OUTDIR
  kbuild: add targets to PHONY
  kbuild: don't warn about include/linux/version.h not including itself
  eradicate bashisms in scripts/patch-kernel

12 years agoMerge branch 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek...
Linus Torvalds [Wed, 25 May 2011 19:03:47 +0000 (12:03 -0700)]
Merge branch 'packaging' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kbuild: Create a kernel-headers RPM
  rpm-pkg: Fix when current directory is a symlink
  Replace '-' in kernel version with '_'

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Wed, 25 May 2011 18:46:31 +0000 (11:46 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (23 commits)
  ceph: fix cap flush race reentrancy
  libceph: subscribe to osdmap when cluster is full
  libceph: handle new osdmap down/state change encoding
  rbd: handle online resize of underlying rbd image
  ceph: avoid inode lookup on nfs fh reconnect
  ceph: use LOOKUPINO to make unconnected nfs fh more reliable
  rbd: use snprintf for disk->disk_name
  rbd: cleanup: make kfree match kmalloc
  rbd: warn on update_snaps failure on notify
  ceph: check return value for start_request in writepages
  ceph: remove useless check
  libceph: add missing breaks in addr_set_port
  libceph: fix TAG_WAIT case
  ceph: fix broken comparison in readdir loop
  libceph: fix osdmap timestamp assignment
  ceph: fix rare potential cap leak
  libceph: use snprintf for unknown addrs
  libceph: use snprintf for formatting object name
  ceph: use snprintf for dirstat content
  libceph: fix uninitialized value when no get_authorizer method is set
  ...

12 years agohwmon: New driver for the SMSC EMC6W201
Jean Delvare [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
hwmon: New driver for the SMSC EMC6W201

This is a new driver for the SMSC EMC6W201 hardware monitoring device.
The device is functionally close to the EMC6D100 series, but is
register-incompatible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Harry G McGavran Jr <w5pny@arrl.net>
Tested-by: Jeff Rickman <jrickman@myamigos.us>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (abituguru) Depend on DMI
Jean Delvare [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
hwmon: (abituguru) Depend on DMI

The abituguru drivers are only built on X86, where DMI support is now
enabled by default. So let these drivers depend on DMI, for the
following gains:
* Robustness and safety. Detection of these devices is weak and uses
  non-standard methods, it should really be limited to Abit boards
  unless the user explicitly asks otherwise.
* Code simplicity. The code is easier to read without ifdefs.
* Better build testing coverage. Now there's only one way to build the
  drivers, so no risk of build failure on exotic systems.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Alistair John Strachan <alistair@devzero.co.uk>
Acked-by: Hans de Goede <hdegoede@redhat.com>
12 years agohwmon: (it87) Use request_muxed_region
Nat Gurumoorthy [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
hwmon: (it87) Use request_muxed_region

Serialize access to the hardware by using "request_muxed_region" macro
defined by Alan Cox. Call to this macro will hold off the requestor if
the resource is currently busy. "superio_enter" will return an error
if call to "request_muxed_region" fails. Rest of the code change is to
ripple an error return from superio_enter to the top level.

Signed-off-by: Nat Gurumoorthy <natg@google.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (sch5627) Trigger Vbat measurements
Hans de Goede [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
hwmon: (sch5627) Trigger Vbat measurements

The sch5627 needs to be explicitly told to start an adc conversion
for Vbat, once in a while. Without this Vbat may read 0, and will never
get updated.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (sch5627) Add sch5627_send_cmd function
Hans de Goede [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
hwmon: (sch5627) Add sch5627_send_cmd function

This patch generalizes sch5627_read_virtual_reg so that it can
be used to write virtual regs too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Sigend-off-by: Jean Delvare <khali@linux-fr.org>
12 years agoi8k: Integrate with the hwmon subsystem
Jean Delvare [Wed, 25 May 2011 18:43:33 +0000 (20:43 +0200)]
i8k: Integrate with the hwmon subsystem

Let i8k create an hwmon class device so that libsensors will expose
the CPU temperature and fan speeds to monitoring applications.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Massimo Dal Zotto <dz@debian.org>
12 years agohwmon: (max6650) Properly support the MAX6650
Jean Delvare [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (max6650) Properly support the MAX6650

The MAX6650 has only one fan input.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: "Hans J. Koch" <hjk@hansjkoch.de>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (max6650) Drop device detection
Jean Delvare [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (max6650) Drop device detection

MAX6650 device detection is unreliable, we got reports of false
positives. We now have many ways to let users instantiate the devices
explicitly, so unreliable detection should be dropped.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: "Hans J. Koch" <hjk@hansjkoch.de>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agoMove ACPI power meter driver to hwmon
Jean Delvare [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
Move ACPI power meter driver to hwmon

As discussed earlier, the ACPI power meter driver would better live
in drivers/hwmon, as its only purpose is to create hwmon-style
interfaces for ACPI 4.0 power meter devices. Users are more likely to
look for it there, and less likely to accidentally hide it by
unselecting its dependencies.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: "Darrick J. Wong" <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Len Brown <lenb@kernel.org>
12 years agohwmon: (f71882fg) Add support for F71808A
Hans de Goede [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (f71882fg) Add support for F71808A

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (f71882fg) Split has_beep in fan_has_beep and temp_has_beep
Hans de Goede [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (f71882fg) Split has_beep in fan_has_beep and temp_has_beep

Needed for upcoming support of the F71808A.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (asc7621) Drop duplicate dependency
Jean Delvare [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (asc7621) Drop duplicate dependency

The config SENSORS_ASC7621 entry is inside an if HWMON / endif block,
so it already depends on HWMON.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (jc42) Change detection class
Jean Delvare [Wed, 25 May 2011 18:43:32 +0000 (20:43 +0200)]
hwmon: (jc42) Change detection class

While the JC42-compatible chips are temperature sensors, I2C_CLASS_SPD
makes more sense because these chips always live on memory modules.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: Add driver for AMD family 15h processor power information
Andreas Herrmann [Wed, 25 May 2011 18:43:31 +0000 (20:43 +0200)]
hwmon: Add driver for AMD family 15h processor power information

This CPU family provides NB register values to gather following
TDP information

* ProcessorPwrWatts: Specifies in Watts the maximum amount of power
  the processor can support.
* CurrPwrWatts: Specifies in Watts the current amount of power being
  consumed by the processor.

This driver provides

* power1_crit (ProcessorPwrWatts)
* power1_input (CurrPwrWatts)

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (k10temp) Add support for Fam15h (Bulldozer)
Andre Przywara [Wed, 25 May 2011 18:43:31 +0000 (20:43 +0200)]
hwmon: (k10temp) Add support for Fam15h (Bulldozer)

AMDs upcoming CPUs use the same mechanism for the internal
temperature reporting as the Fam10h CPUs, so we just needed to add
the appropriate PCI-ID to the list.
This allows to use the k10temp driver on those CPUs.
While at it change the Kconfig entry to be more generic.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: Use helper functions to set and get driver data
Jean Delvare [Wed, 25 May 2011 18:43:31 +0000 (20:43 +0200)]
hwmon: Use helper functions to set and get driver data

Use helper functions to set and get driver data. This is more elegant.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agoi8k: Avoid lahf in 64-bit code
Luca Tettamanti [Wed, 25 May 2011 18:43:31 +0000 (20:43 +0200)]
i8k: Avoid lahf in 64-bit code

i8k uses lahf to read the flag register in 64-bit code; early x86-64
CPUs, however, lack this instruction and we get an invalid opcode
exception at runtime.
Use pushf to load the flag register into the stack instead.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Reported-by: Jeff Rickman <jrickman@myamigos.us>
Tested-by: Jeff Rickman <jrickman@myamigos.us>
Tested-by: Harry G McGavran Jr <w5pny@arrl.net>
Cc: stable@kernel.org
Cc: Massimo Dal Zotto <dz@debian.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agoMerge branch 'for-davem' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Wed, 25 May 2011 17:28:55 +0000 (13:28 -0400)]
Merge branch 'for-davem' of ssh:///linux/kernel/git/linville/wireless-next-2.6

12 years agosignal: sys_pause() should check signal_pending()
Oleg Nesterov [Wed, 25 May 2011 17:22:27 +0000 (19:22 +0200)]
signal: sys_pause() should check signal_pending()

ERESTART* is always wrong without TIF_SIGPENDING. Teach sys_pause()
to handle the spurious wakeup correctly.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
12 years agoptrace: ptrace_resume() shouldn't wake up !TASK_TRACED thread
Oleg Nesterov [Wed, 25 May 2011 17:20:21 +0000 (19:20 +0200)]
ptrace: ptrace_resume() shouldn't wake up !TASK_TRACED thread

It is not clear why ptrace_resume() does wake_up_process(). Unless the
caller is PTRACE_KILL the tracee should be TASK_TRACED so we can use
wake_up_state(__TASK_TRACED). If sys_ptrace() races with SIGKILL we do
not need the extra and potentionally spurious wakeup.

If the caller is PTRACE_KILL, wake_up_process() is even more wrong.
The tracee can sleep in any state in any place, and if we have a buggy
code which doesn't handle a spurious wakeup correctly PTRACE_KILL can
be used to exploit it. For example:

int main(void)
{
int child, status;

child = fork();
if (!child) {
int ret;

assert(ptrace(PTRACE_TRACEME, 0,0,0) == 0);

ret = pause();
printf("pause: %d %m\n", ret);

return 0x23;
}

sleep(1);
assert(ptrace(PTRACE_KILL, child, 0,0) == 0);

assert(child == wait(&status));
printf("wait: %x\n", status);

return 0;
}

prints "pause: -1 Unknown error 514", -ERESTARTNOHAND leaks to the
userland. In this case sys_pause() is buggy as well and should be
fixed.

I do not know what was the original rationality behind PTRACE_KILL.
The man page is simply wrong and afaics it was always wrong. Imho
it should be deprecated, or may be it should do send_sig(SIGKILL)
as Denys suggests, but in any case I do not think that the current
behaviour was intentional.

Note: there is another problem, ptrace_resume() changes ->exit_code
and this can race with SIGKILL too. Eventually we should change ptrace
to not use ->exit_code.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
Linus Torvalds [Wed, 25 May 2011 16:21:56 +0000 (09:21 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ericvh/v9fs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9p: update Documentation pointers
  net/9p: enable 9p to work in non-default network namespace
  net/9p: p9_idpool_get return -1 on error
  fs/9p: Don't clunk dentry fid when we fail to get a writeback inode
  9p: Small cleanup in <net/9p/9p.h>
  9p: remove experimental tag from tested configurations
  9p: typo fixes and minor cleanups
  net/9p: Change linuxdoc names to match functions.

12 years agoMerge branch 'for-2.6.40/splice' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Wed, 25 May 2011 16:20:20 +0000 (09:20 -0700)]
Merge branch 'for-2.6.40/splice' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.40/splice' of git://git.kernel.dk/linux-2.6-block:
  splice: add wakeup_pipe_readers()

12 years agoMerge branch 'for-2.6.40/drivers' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Wed, 25 May 2011 16:15:35 +0000 (09:15 -0700)]
Merge branch 'for-2.6.40/drivers' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.40/drivers' of git://git.kernel.dk/linux-2.6-block: (110 commits)
  loop: handle on-demand devices correctly
  loop: limit 'max_part' module param to DISK_MAX_PARTS
  drbd: fix warning
  drbd: fix warning
  drbd: Fix spelling
  drbd: fix schedule in atomic
  drbd: Take a more conservative approach when deciding max_bio_size
  drbd: Fixed state transitions after async outdate-peer-handler returned
  drbd: Disallow the peer_disk_state to be D_OUTDATED while connected
  drbd: Fix for the connection problems on high latency links
  drbd: fix potential activity log refcount imbalance in error path
  drbd: Only downgrade the disk state in case of disk failures
  drbd: fix disconnect/reconnect loop, if ping-timeout == ping-int
  drbd: fix potential distributed deadlock
  lru_cache.h: fix comments referring to ts_ instead of lc_
  drbd: Fix for application IO with the on-io-error=pass-on policy
  xen/p2m: Add EXPORT_SYMBOL_GPL to the M2P override functions.
  xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override.
  xen/blkback: don't fail empty barrier requests
  xen/blkback: fix xenbus_transaction_start() hang caused by double xenbus_transaction_end()
  ...

12 years agoMerge branch 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Wed, 25 May 2011 16:14:07 +0000 (09:14 -0700)]
Merge branch 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block: (40 commits)
  cfq-iosched: free cic_index if cfqd allocation fails
  cfq-iosched: remove unused 'group_changed' in cfq_service_tree_add()
  cfq-iosched: reduce bit operations in cfq_choose_req()
  cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
  blk-cgroup: Initialize ioc->cgroup_changed at ioc creation time
  block: move bd_set_size() above rescan_partitions() in __blkdev_get()
  block: call elv_bio_merged() when merged
  cfq-iosched: Make IO merge related stats per cpu
  cfq-iosched: Fix a memory leak of per cpu stats for root group
  backing-dev: Kill set but not used var in  bdi_debug_stats_show()
  block: get rid of on-stack plugging debug checks
  blk-throttle: Make no throttling rule group processing lockless
  blk-cgroup: Make cgroup stat reset path blkg->lock free for dispatch stats
  blk-cgroup: Make 64bit per cpu stats safe on 32bit arch
  blk-throttle: Make dispatch stats per cpu
  blk-throttle: Free up a group only after one rcu grace period
  blk-throttle: Use helper function to add root throtl group to lists
  blk-throttle: Introduce a helper function to fill in device details
  blk-throttle: Dynamically allocate root group
  blk-cgroup: Allow sleeping while dynamically allocating a group
  ...

12 years agoMerge branch 'timers-ptp-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 25 May 2011 15:59:42 +0000 (08:59 -0700)]
Merge branch 'timers-ptp-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-ptp-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ptp: Fix dp83640 build warning when building statically
  ptp: Added a clock driver for the National Semiconductor PHYTER.
  ptp: Added a clock driver for the IXP46x.
  ptp: Added a clock that uses the eTSEC found on the MPC85xx.
  ptp: Added a brand new class driver for ptp clocks.

12 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 25 May 2011 15:58:50 +0000 (08:58 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  posix-timers: RCU conversion

12 years agoxfs: correctly decrement the extent buffer index in xfs_bmap_del_extent
Christoph Hellwig [Wed, 11 May 2011 15:04:05 +0000 (15:04 +0000)]
xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent

The code in xfs_bmap_del_extent does not correctly decrement the
extent buffer index when deleting a whole extent.  Most of the time
this gets caught by checks in xfs_bmapi that work around it and
decrement it manually and thus wasn't noticed so far.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: check for valid indices in xfs_iext_get_ext and xfs_iext_idx_to_irec
Christoph Hellwig [Wed, 11 May 2011 15:04:11 +0000 (15:04 +0000)]
xfs: check for valid indices in xfs_iext_get_ext and xfs_iext_idx_to_irec

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: fix up asserts in xfs_iflush_fork
Christoph Hellwig [Wed, 11 May 2011 15:04:10 +0000 (15:04 +0000)]
xfs: fix up asserts in xfs_iflush_fork

Remove asserts in xfs_iflush_fork that would call xfs_iext_get_ext
with a potentially invalid extent buffer index.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: do not do pointer arithmetic on extent records
Christoph Hellwig [Wed, 11 May 2011 15:04:09 +0000 (15:04 +0000)]
xfs: do not do pointer arithmetic on extent records

We need to call xfs_iext_get_ext for the previous extent to get a
valid pointer, and can't just do pointer arithmetics as they might
be in different pages.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: do not use unchecked extent indices in xfs_bunmapi
Christoph Hellwig [Wed, 11 May 2011 15:04:08 +0000 (15:04 +0000)]
xfs: do not use unchecked extent indices in xfs_bunmapi

Make sure to only call xfs_iext_get_ext after we've validate the
extent index when moving on to the next index in xfs_bunmapi.  Also
remove the old workaround for too large indices that has been
superceeded by the proper fix in xfs_bmap_del_extent.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: do not use unchecked extent indices in xfs_bmapi
Christoph Hellwig [Wed, 11 May 2011 15:04:07 +0000 (15:04 +0000)]
xfs: do not use unchecked extent indices in xfs_bmapi

Make sure to only call xfs_iext_get_ext after we've validate the
extent index when moving on to the next index in xfs_bmapi.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: do not use unchecked extent indices in xfs_bmap_add_extent_*
Christoph Hellwig [Wed, 11 May 2011 15:04:06 +0000 (15:04 +0000)]
xfs: do not use unchecked extent indices in xfs_bmap_add_extent_*

Make sure to only call xfs_iext_get_ext after we've validate the
extent index in the various xfs_bmap_add_extent_* helpers.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfs: remove if_lastex
Christoph Hellwig [Mon, 23 May 2011 08:52:53 +0000 (08:52 +0000)]
xfs: remove if_lastex

The if_lastex field in struct xfs_ifork is only used as a temporary
index during xfs_bmapi and xfs_bunmapi.  Instead of using the inode
fork to store it keep it local in the callchain.  Fortunately this
is very easy as we already pass a stack copy of it down the whole
chain which can simplify be changed to be passed by reference.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>