pandora-kernel.git
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
Linus Torvalds [Thu, 19 May 2011 23:27:21 +0000 (16:27 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/geert/linux-m68k

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  input/atari: Fix mouse movement and button mapping
  input/atari: Fix atarimouse init
  input/atari: Use the correct mouse interrupt hook
  m68k/atari: Do not use "/" in interrupt names
  m68k: unistd - Comment out definitions for unimplemented syscalls
  m68k: Really wire up sys_pselect6 and sys_ppoll
  m68k: Merge mmu and non-mmu versions of sys_call_table
  MAINTAINERS: Roman Zippel has been MIA for several years.
  m68k: bitops - Never step beyond the end of the bitmap
  m68k: bitops - offset == ((long)p - (long)vaddr) * 8

12 years agocore_kernel_data(): Fix architectures that do not define _sdata
Ingo Molnar [Thu, 19 May 2011 23:22:14 +0000 (01:22 +0200)]
core_kernel_data(): Fix architectures that do not define _sdata

Some architectures such as Alpha do not define _sdata but _data:

  kernel/built-in.o: In function `core_kernel_data':
  kernel/extable.c:77: undefined reference to `_sdata'

So expand the scope of the data range to the text addresses too,
this might be more correct anyway because this way we can
cover readonly variables as well.

Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-i878c8a0e0g0ep4v7i6vxnhz@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 years agonetworking: NET_CLS_ROUTE4 depends on INET
Randy Dunlap [Thu, 19 May 2011 23:23:28 +0000 (19:23 -0400)]
networking: NET_CLS_ROUTE4 depends on INET

IP_ROUTE_CLASSID depends on INET and NET_CLS_ROUTE4 selects
IP_ROUTE_CLASSID, but when INET is not enabled, this kconfig warning
is produced, so fix it by making NET_CLS_ROUTE4 depend on INET.

warning: (NET_CLS_ROUTE4) selects IP_ROUTE_CLASSID which has unmet direct dependencies (NET && INET)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branches 'stable/irq', 'stable/p2m.bugfixes', 'stable/e820.bugfixes' and 'stabl...
Linus Torvalds [Thu, 19 May 2011 23:14:58 +0000 (16:14 -0700)]
Merge branches 'stable/irq', 'stable/p2m.bugfixes', 'stable/e820.bugfixes' and 'stable/mmu.bugfixes' of git://git./linux/kernel/git/konrad/xen

* 'stable/irq' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: do not clear and mask evtchns in __xen_evtchn_do_upcall

* 'stable/p2m.bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/p2m: Create entries in the P2M_MFN trees's to track 1-1 mappings

* 'stable/e820.bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/setup: Fix for incorrect xen_extra_mem_start initialization under 32-bit
  xen/setup: Ignore E820_UNUSABLE when setting 1-1 mappings.

* 'stable/mmu.bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen mmu: fix a race window causing leave_mm BUG()

12 years agoMerge branches 'stable/balloon.cleanup' and 'stable/general.cleanup' of git://git...
Linus Torvalds [Thu, 19 May 2011 23:14:35 +0000 (16:14 -0700)]
Merge branches 'stable/balloon.cleanup' and 'stable/general.cleanup' of git://git./linux/kernel/git/konrad/xen

* 'stable/balloon.cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/balloon: Move dec_totalhigh_pages() from __balloon_append() to balloon_append()
  xen/balloon: Clarify credit calculation
  xen/balloon: Simplify HVM integration
  xen/balloon: Use PageHighMem() for high memory page detection

* 'stable/general.cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  drivers/xen/sys-hypervisor: Cleanup code/data sections definitions
  arch/x86/xen/smp: Cleanup code/data sections definitions
  arch/x86/xen/time: Cleanup code/data sections definitions
  arch/x86/xen/xen-ops: Cleanup code/data sections definitions
  arch/x86/xen/mmu: Cleanup code/data sections definitions
  arch/x86/xen/setup: Cleanup code/data sections definitions
  arch/x86/xen/enlighten: Cleanup code/data sections definitions
  arch/x86/xen/irq: Cleanup code/data sections definitions
  xen: tidy up whitespace in drivers/xen/Makefile

12 years agoMerge branches 'stable/backend.base.v3' and 'stable/gntalloc.v7' of git://git.kernel...
Linus Torvalds [Thu, 19 May 2011 23:14:25 +0000 (16:14 -0700)]
Merge branches 'stable/backend.base.v3' and 'stable/gntalloc.v7' of git://git./linux/kernel/git/konrad/xen

* 'stable/backend.base.v3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/pci: Fix compiler error when CONFIG_XEN_PRIVILEGED_GUEST is not set.
  xen/p2m: Add EXPORT_SYMBOL_GPL to the M2P override functions.
  xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override.
  xen/irq: The Xen hypervisor cleans up the PIRQs if the other domain forgot.
  xen/irq: Export 'xen_pirq_from_irq' function.
  xen/irq: Add support to check if IRQ line is shared with other domains.
  xen/irq: Check if the PCI device is owned by a domain different than DOMID_SELF.
  xen/pci: Add xen_[find|register|unregister]_device_domain_owner functions.

* 'stable/gntalloc.v7' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/gntdev,gntalloc: Remove unneeded VM flags

12 years agoMerge branch 'stable/broadcom.ibft' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 19 May 2011 23:14:02 +0000 (16:14 -0700)]
Merge branch 'stable/broadcom.ibft' of git://git./linux/kernel/git/konrad/ibft-2.6

* 'stable/broadcom.ibft' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6:
  iscsi_ibft: search for broadcom specific ibft sign (v2)

12 years agoMerge branch 'move-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/davej...
Linus Torvalds [Thu, 19 May 2011 22:59:24 +0000 (15:59 -0700)]
Merge branch 'move-drivers' of git://git./linux/kernel/git/davej/cpufreq

* 'move-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Move x86 drivers to drivers/cpufreq/

12 years agoirda: Fix error propagation in ircomm_lmp_connect_response()
David S. Miller [Thu, 19 May 2011 22:58:39 +0000 (18:58 -0400)]
irda: Fix error propagation in ircomm_lmp_connect_response()

The variable 'ret' is set but unused, and this pointed out that
errors from irlmp_connect_response() are not propagated to the
caller.

Note that this is currently academic since irlmp_connect_response()
always returns 0. :-)

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Thu, 19 May 2011 22:57:29 +0000 (15:57 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] remove redundant sprintf from request_module call.
  [CPUFREQ] cpufreq_stats.c: Fixed brace coding style issue
  [CPUFREQ] Fix memory leak in cpufreq_stat
  [CPUFREQ] cpufreq.h: Fix some checkpatch.pl coding style issues.
  [CPUFREQ] use dynamic debug instead of custom infrastructure
  [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks
  [CPUFREQ] Fix _OSC UUID in pcc-cpufreq

12 years agoirda: Kill set but unused variable 'bytes' in irlan_check_command_param()
David S. Miller [Thu, 19 May 2011 22:53:58 +0000 (18:53 -0400)]
irda: Kill set but unused variable 'bytes' in irlan_check_command_param()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoirda: Kill set but unused variable 'clen' in ircomm_connect_indication()
David S. Miller [Thu, 19 May 2011 22:52:59 +0000 (18:52 -0400)]
irda: Kill set but unused variable 'clen' in ircomm_connect_indication()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
David S. Miller [Thu, 19 May 2011 22:51:50 +0000 (18:51 -0400)]
rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()

This is identical to the case I fixed in rxrpc_get_peer()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years ago[CPUFREQ] Move x86 drivers to drivers/cpufreq/
Dave Jones [Thu, 19 May 2011 22:51:07 +0000 (18:51 -0400)]
[CPUFREQ] Move x86 drivers to drivers/cpufreq/

Signed-off-by: Dave Jones <davej@redhat.com>
12 years agobe2net: Kill set but unused variable 'req' in lancer_fw_download()
David S. Miller [Thu, 19 May 2011 22:49:54 +0000 (18:49 -0400)]
be2net: Kill set but unused variable 'req' in lancer_fw_download()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoirda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
David S. Miller [Thu, 19 May 2011 22:46:41 +0000 (18:46 -0400)]
irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoatl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
David S. Miller [Thu, 19 May 2011 22:44:41 +0000 (18:44 -0400)]
atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
David S. Miller [Thu, 19 May 2011 22:41:03 +0000 (18:41 -0400)]
rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().

I backed off from trying to just eliminate this variable, since
transforming atomic_inc_return() into atomic_inc() takes away
the memory barriers.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
David S. Miller [Thu, 19 May 2011 22:37:11 +0000 (18:37 -0400)]
rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
David S. Miller [Thu, 19 May 2011 22:35:58 +0000 (18:35 -0400)]
rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agorxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
David S. Miller [Thu, 19 May 2011 22:34:37 +0000 (18:34 -0400)]
rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agopkt_sched: Kill set but unused variable 'protocol' in tc_classify()
David S. Miller [Thu, 19 May 2011 22:32:55 +0000 (18:32 -0400)]
pkt_sched: Kill set but unused variable 'protocol' in tc_classify()

I checked the history and this has been like this since the
beginning of time.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoisdn: capi: Use pr_debug() instead of ifdefs.
David S. Miller [Thu, 19 May 2011 22:20:29 +0000 (18:20 -0400)]
isdn: capi: Use pr_debug() instead of ifdefs.

I was investigating some warnings that spew because of the
_DEBUG_FOO ifdef'ery in here.

Instead of adding more ifdefs to fix that warning, let's use
pr_debug() and get rid of these CPP checks altogether.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Update version to 3.119
Matt Carlson [Thu, 19 May 2011 12:12:56 +0000 (12:12 +0000)]
tg3: Update version to 3.119

This patch updates the tg3 version to 3.119.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Apply rx_discards fix to 5719/5720
Matt Carlson [Thu, 19 May 2011 12:12:55 +0000 (12:12 +0000)]
tg3: Apply rx_discards fix to 5719/5720

Commit 4d95847381228639844c7197deb8b2211274ef22, entitled
"tg3: Workaround rx_discards stat bug", was intended to be applied to
the 5717, 5718, 5719_A0, and 5720 A0 chip revisions.  The implementation
missed the latter two when applying the fix in a critical area.  This
patch fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Remove excessive parenthesis
Matt Carlson [Thu, 19 May 2011 12:12:54 +0000 (12:12 +0000)]
tg3: Remove excessive parenthesis

This patch removes some excessive parenthesizing.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Consolidate all netdev feature assignments
Matt Carlson [Thu, 19 May 2011 12:12:53 +0000 (12:12 +0000)]
tg3: Consolidate all netdev feature assignments

This patch consolidates all the netdev feature bit assignments to one
location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Move TSO_CAPABLE assignment
Matt Carlson [Thu, 19 May 2011 12:12:52 +0000 (12:12 +0000)]
tg3: Move TSO_CAPABLE assignment

This patch moves the code that asserts the TSO_CAPABLE flag closer to
where the TSO capabilities flags are set.  There isn't a good enough
reason for the code to be separated.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Fix stats for 5704 and later devices
Matt Carlson [Thu, 19 May 2011 12:12:51 +0000 (12:12 +0000)]
tg3: Fix stats for 5704 and later devices

Commit 4d95847381228639844c7197deb8b2211274ef22, entitled
"tg3: Workaround rx_discards stat bug" modified the hardware statistics
data structure.  The modification shifted the statistics so that the
labels no longer corresponded to the counter values.  This patch fixes
the problem by utilizing reserved space for the new counters.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Fix TSO loopback test
Matt Carlson [Thu, 19 May 2011 12:12:50 +0000 (12:12 +0000)]
tg3: Fix TSO loopback test

Commit bb158d696489244f79fd4c3abd47968a06b48c79, entitled
"tg3: Add TSO loopback test", mistakenly inverted the checksum field
test from the receive BD.  This patch corrects the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Consolidate autoneg advertisement setup code
Matt Carlson [Thu, 19 May 2011 12:12:49 +0000 (12:12 +0000)]
tg3: Consolidate autoneg advertisement setup code

Autonegotiation setup has gotten a little more complicated since the tg3
driver was created.  This patch consolidates autoneg setup into one
routine and modifies the call sites accordingly.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Fix EEE interoperability workaround
Matt Carlson [Thu, 19 May 2011 12:12:48 +0000 (12:12 +0000)]
tg3: Fix EEE interoperability workaround

Commit 21a00ab270f95d32e502d92f166dd75c518d3c5f, entitled
"tg3: Fix EEE interoperability issue", added an EEE interoperability
fix.  We found that the fix doesn't work if applied too early though.
This patch delays the fix until right before allowing LPI assertion.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Fix IPv6 TCP problems for 5719
Matt Carlson [Thu, 19 May 2011 12:12:47 +0000 (12:12 +0000)]
tg3: Fix IPv6 TCP problems for 5719

Commit 4d163b75e979833979cc401ae433cb1d7743d57e, entitled
"tg3: Fix 5719 A0 tx completion bug" turned off TSO to fix a hardware
bug.  In doing so, it accidentally turned off all IPv6 TCP checksum
offloading too.  This patch fixes the problem by reenabling the hardware
bit that control both features.  The TSO capability is still not exposed
to the kernel.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Fix 57765 B0 data corruption
Matt Carlson [Thu, 19 May 2011 12:12:46 +0000 (12:12 +0000)]
tg3: Fix 57765 B0 data corruption

The PCIe max FTS limit is too aggressive on these chips.  This patch
loosens the limit a little to eliminate data corruption issues.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Cleanup transmit error path
Matt Carlson [Thu, 19 May 2011 12:12:45 +0000 (12:12 +0000)]
tg3: Cleanup transmit error path

This patch consolidates the skb cleanup code into a function named
tg3_skb_error_unmap().  The modification addresses a long-standing bug
where pci_unmap_single() was incorrectly being called instead of
pci_unmap_page() in tigon3_dma_hwbug_workaround().

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: Set tx bug flags for more devices
Matt Carlson [Thu, 19 May 2011 12:12:44 +0000 (12:12 +0000)]
tg3: Set tx bug flags for more devices

It has been recently discovered that all tg3 devices have a 4Gb boundary
DMA problem, and that all 5755 and newer devices can't handle fragments
less than or equal to 8 bytes in size.  This patch adjusts the flags and
removes tg3_start_xmit().  tg3_start_xmit_dma_bug() has been renamed to
tg3_start_xmit().

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Thu, 19 May 2011 21:56:13 +0000 (14:56 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  params.c: Use new strtobool function to process boolean inputs
  debugfs: move to new strtobool
  Add a strtobool function matching semantics of existing in kernel equivalents
  modpost: Update 64k section support for binutils 2.18.50
  module: Use binary search in lookup_symbol()
  module: Use the binary search for symbols resolution
  lib: Add generic binary search function to the kernel.
  module: Sort exported symbols
  module: each_symbol_section instead of each_symbol
  module: split unset_section_ro_nx function.
  module: undo module RONX protection correctly.
  module: zero mod->init_ro_size after init is freed.
  minor ANSI prototype sparse fix
  module: reorder kparam_array to remove alignment padding on 64 bit builds
  module: remove 64 bit alignment padding from struct module with CONFIG_TRACE*
  module: do not hide __modver_version_show declaration behind ifdef
  module: deal with alignment issues in built-in module versions

12 years agoMerge branch 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap...
Linus Torvalds [Thu, 19 May 2011 21:55:34 +0000 (14:55 -0700)]
Merge branch 'docs-move' of git://git./linux/kernel/git/rdunlap/linux-docs

* 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs:
  Correct occurrences of - Documentation/kvm/ to Documentation/virtual/kvm - Documentation/uml/ to Documentation/virtual/uml - Documentation/lguest/ to Documentation/virtual/lguest throughout the kernel source tree.
  Add a 00-INDEX file to Documentation/virtual Remove uml from the top level 00-INDEX file.
  Move kvm, uml, and lguest subdirectories under a common "virtual" directory, I.E:

12 years ago9p: Kill unused variable 'ret' in trans_rdma.c:parse_opts()
David S. Miller [Thu, 19 May 2011 21:45:29 +0000 (17:45 -0400)]
9p: Kill unused variable 'ret' in trans_rdma.c:parse_opts()

Probably just cut and pasted from the other parse_opts() implementations
in the 9p sources.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years ago9p: Kill set but not used variable 'ret' in parse_opts()
David S. Miller [Thu, 19 May 2011 21:38:57 +0000 (17:38 -0400)]
9p: Kill set but not used variable 'ret' in parse_opts()

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoRevert "rcu: Decrease memory-barrier usage based on semi-formal proof"
Paul E. McKenney [Thu, 12 May 2011 08:08:07 +0000 (01:08 -0700)]
Revert "rcu: Decrease memory-barrier usage based on semi-formal proof"

This reverts commit e59fb3120becfb36b22ddb8bd27d065d3cdca499.

This reversion was due to (extreme) boot-time slowdowns on SPARC seen by
Yinghai Lu and on x86 by Ingo
.
This is a non-trivial reversion due to intervening commits.

Conflicts:

Documentation/RCU/trace.txt
kernel/rcutree.c

Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 years agolist: remove prefetching from regular list iterators
Linus Torvalds [Thu, 19 May 2011 21:15:29 +0000 (14:15 -0700)]
list: remove prefetching from regular list iterators

This is removes the use of software prefetching from the regular list
iterators.  We don't want it.  If you do want to prefetch in some
iterator of yours, go right ahead.  Just don't expect the iterator to do
it, since normally the downsides are bigger than the upsides.

It also replaces <linux/prefetch.h> with <linux/const.h>, because the
use of LIST_POISON ends up needing it.  <linux/poison.h> is sadly not
self-contained, and including prefetch.h just happened to hide that.

Suggested by David Miller (networking has a lot of regular lists that
are often empty or a single entry, and prefetching is not going to do
anything but add useless instructions).

Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoipconfig wait for carrier
Micha Nelissen [Thu, 19 May 2011 10:14:06 +0000 (10:14 +0000)]
ipconfig wait for carrier

v3 -> v4: fix return boolean false instead of 0 for ic_is_init_dev

Currently the ip auto configuration has a hardcoded delay of 1 second.
When (ethernet) link takes longer to come up (e.g. more than 3 seconds),
nfs root may not be found.

Remove the hardcoded delay, and wait for carrier on at least one network
device.

Signed-off-by: Micha Nelissen <micha@neli.hopto.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoSCTP: fix race between sctp_bind_addr_free() and sctp_bind_addr_conflict()
Jacek Luczak [Thu, 19 May 2011 09:55:13 +0000 (09:55 +0000)]
SCTP: fix race between sctp_bind_addr_free() and sctp_bind_addr_conflict()

During the sctp_close() call, we do not use rcu primitives to
destroy the address list attached to the endpoint.  At the same
time, we do the removal of addresses from this list before
attempting to remove the socket from the port hash

As a result, it is possible for another process to find the socket
in the port hash that is in the process of being closed.  It then
proceeds to traverse the address list to find the conflict, only
to have that address list suddenly disappear without rcu() critical
section.

Fix issue by closing address list removal inside RCU critical
section.

Race can result in a kernel crash with general protection fault or
kernel NULL pointer dereference:

kernel: general protection fault: 0000 [#1] SMP
kernel: RIP: 0010:[<ffffffffa02f3dde>]  [<ffffffffa02f3dde>] sctp_bind_addr_conflict+0x64/0x82 [sctp]
kernel: Call Trace:
kernel:  [<ffffffffa02f415f>] ? sctp_get_port_local+0x17b/0x2a3 [sctp]
kernel:  [<ffffffffa02f3d45>] ? sctp_bind_addr_match+0x33/0x68 [sctp]
kernel:  [<ffffffffa02f4416>] ? sctp_do_bind+0xd3/0x141 [sctp]
kernel:  [<ffffffffa02f5030>] ? sctp_bindx_add+0x4d/0x8e [sctp]
kernel:  [<ffffffffa02f5183>] ? sctp_setsockopt_bindx+0x112/0x4a4 [sctp]
kernel:  [<ffffffff81089e82>] ? generic_file_aio_write+0x7f/0x9b
kernel:  [<ffffffffa02f763e>] ? sctp_setsockopt+0x14f/0xfee [sctp]
kernel:  [<ffffffff810c11fb>] ? do_sync_write+0xab/0xeb
kernel:  [<ffffffff810e82ab>] ? fsnotify+0x239/0x282
kernel:  [<ffffffff810c2462>] ? alloc_file+0x18/0xb1
kernel:  [<ffffffff8134a0b1>] ? compat_sys_setsockopt+0x1a5/0x1d9
kernel:  [<ffffffff8134aaf1>] ? compat_sys_socketcall+0x143/0x1a4
kernel:  [<ffffffff810467dc>] ? sysenter_dispatch+0x7/0x32

Signed-off-by: Jacek Luczak <luczak.jacek@gmail.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agohlist: remove software prefetching in hlist iterators
Linus Torvalds [Thu, 19 May 2011 20:50:07 +0000 (13:50 -0700)]
hlist: remove software prefetching in hlist iterators

They not only increase the code footprint, they actually make things
slower rather than faster.  On internationally acclaimed benchmarks
("make -j16" on an already fully built kernel source tree) the hlist
prefetching slows down the build by up to 1%.

(Almost all of it comes from hlist_for_each_entry_rcu() as used by
avc_has_perm_noaudit(), which is very hot due to all the pathname
lookups to see if there is anything to do).

The cause seems to be two-fold:

 - on at least some Intel cores, prefetch(NULL) ends up with some
   microarchitectural stall due to the TLB miss that it incurs.  The
   hlist case triggers this very commonly, since the NULL pointer is the
   last entry in the list.

 - the prefetch appears to cause more D$ activity, probably because it
   prefetches hash list entries that are never actually used (because we
   ended the search early due to a hit).

Regardless, the numbers clearly say that the implicit prefetching is
simply a bad idea.  If some _particular_ user of the hlist iterators
wants to prefetch the next list entry, they can do so themselves
explicitly, rather than depend on all list iterators doing so
implicitly.

Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoipv6: reduce per device ICMP mib sizes
Eric Dumazet [Thu, 19 May 2011 01:14:23 +0000 (01:14 +0000)]
ipv6: reduce per device ICMP mib sizes

ipv6 has per device ICMP SNMP counters, taking too much space because
they use percpu storage.

needed size per device is :
(512+4)*sizeof(long)*number_of_possible_cpus*2

On a 32bit kernel, 16 possible cpus, this wastes more than 64kbytes of
memory per ipv6 enabled network device, taken in vmalloc pool.

Since ICMP messages are rare, just use shared counters (atomic_long_t)

Per network space ICMP counters are still using percpu memory, we might
also convert them to shared counters in a future patch.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ping: fix the coding style
Changli Gao [Wed, 18 May 2011 21:16:01 +0000 (21:16 +0000)]
net: ping: fix the coding style

The characters in a line should be no more than 80.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: ping: make local functions static
Changli Gao [Wed, 18 May 2011 21:16:00 +0000 (21:16 +0000)]
net: ping: make local functions static

As these functions are only used in this file.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Thu, 19 May 2011 19:55:45 +0000 (15:55 -0400)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

12 years agoMerge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Ingo Molnar [Thu, 19 May 2011 17:48:03 +0000 (19:48 +0200)]
Merge branch 'tip/perf/core' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into perf/core

12 years agoMerge branch 'tip/perf/core-3' of git://git.kernel.org/pub/scm/linux/kernel/git/roste...
Ingo Molnar [Thu, 19 May 2011 17:25:55 +0000 (19:25 +0200)]
Merge branch 'tip/perf/core-3' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into perf/core

12 years agokmemleak: Initialise kmemleak after debug_objects_mem_init()
Catalin Marinas [Thu, 19 May 2011 15:25:30 +0000 (16:25 +0100)]
kmemleak: Initialise kmemleak after debug_objects_mem_init()

Kmemleak frees objects via RCU and when CONFIG_DEBUG_OBJECTS_RCU_HEAD
is enabled, the RCU callback triggers a call to free_object() in
lib/debugobjects.c. Since kmemleak is initialised before debug objects
initialisation, it may result in a kernel panic during booting. This
patch moves the kmemleak_init() call after debug_objects_mem_init().

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: <stable@kernel.org>
12 years agokmemleak: Select DEBUG_FS unconditionally in DEBUG_KMEMLEAK
Catalin Marinas [Wed, 27 Apr 2011 16:06:19 +0000 (17:06 +0100)]
kmemleak: Select DEBUG_FS unconditionally in DEBUG_KMEMLEAK

In the past DEBUG_FS used to depend on SYSFS and DEBUG_KMEMLEAK selected
it conditionally. This is no longer the case, so always select DEBUG_FS
via DEBUG_KMEMLEAK.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
12 years agokmemleak: Do not return a pointer to an object that kmemleak did not get
Catalin Marinas [Wed, 27 Apr 2011 15:44:26 +0000 (16:44 +0100)]
kmemleak: Do not return a pointer to an object that kmemleak did not get

The kmemleak_seq_next() function tries to get an object (and increment
its use count) before returning it. If it could not get the last object
during list traversal (because it may have been freed), the function
should return NULL rather than a pointer to such object that it did not
get.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: <stable@kernel.org>
12 years agoinput/atari: Fix mouse movement and button mapping
Geert Uytterhoeven [Mon, 31 Jan 2011 19:15:04 +0000 (20:15 +0100)]
input/atari: Fix mouse movement and button mapping

Up and down movements were reversed, left and right buttons were swapped.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agoinput/atari: Fix atarimouse init
Michael Schmitz [Sun, 28 Dec 2008 22:00:45 +0000 (23:00 +0100)]
input/atari: Fix atarimouse init

Atarimouse fails to load as a module (with ENODEV), due to a brown paper
bag bug, misinterpreting the semantics of atari_keyb_init().

[geert] Propagate the return value of atari_keyb_init() everywhere

Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agoinput/atari: Use the correct mouse interrupt hook
Michael Schmitz [Tue, 16 Dec 2008 20:26:03 +0000 (21:26 +0100)]
input/atari: Use the correct mouse interrupt hook

The Atari keyboard driver calls atari_mouse_interrupt_hook if it's set, not
atari_input_mouse_interrupt_hook. Fix below.

[geert] Killed off atari_mouse_interrupt_hook completely, after fixing another
incorrect assignment in atarimouse.c.

Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k/atari: Do not use "/" in interrupt names
Geert Uytterhoeven [Wed, 4 May 2011 12:55:41 +0000 (14:55 +0200)]
m68k/atari: Do not use "/" in interrupt names

It may trigger a warning in fs/proc/generic.c:__xlate_proc_name() when
trying to add an entry for the interrupt handler to sysfs.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: unistd - Comment out definitions for unimplemented syscalls
Geert Uytterhoeven [Thu, 5 May 2011 18:33:02 +0000 (20:33 +0200)]
m68k: unistd - Comment out definitions for unimplemented syscalls

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: Really wire up sys_pselect6 and sys_ppoll
Geert Uytterhoeven [Fri, 6 May 2011 18:57:11 +0000 (20:57 +0200)]
m68k: Really wire up sys_pselect6 and sys_ppoll

We reserved the numbers a long time ago, but never wired them up in the
syscall table as they need TIF_RESTORE_SIGMASK, which we only got last year
in commit cb6831d5d3099e772a510eb3e1ed0760ccffb45e ("m68k: Switch to saner
sigsuspend()")

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: stable@kernel.org
12 years agom68k: Merge mmu and non-mmu versions of sys_call_table
Geert Uytterhoeven [Wed, 6 Apr 2011 20:12:53 +0000 (22:12 +0200)]
m68k: Merge mmu and non-mmu versions of sys_call_table

Impact for nommu:
  - Store table in .rodata instead of .text,
  - Let kernel/sys_ni.c handle the stubbing of MMU-only syscalls,
  - Implement sys_mremap and sys_nfsservct,
  - Remove unused padding at the end of the table.

Impact for mmu:
  - Store table in .rodata instead of .data.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
12 years agoMAINTAINERS: Roman Zippel has been MIA for several years.
Geert Uytterhoeven [Sun, 24 Apr 2011 08:32:49 +0000 (10:32 +0200)]
MAINTAINERS: Roman Zippel has been MIA for several years.

Hence make AFFS and HFS orphans, and remove him as an m68k maintainer.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: bitops - Never step beyond the end of the bitmap
Geert Uytterhoeven [Sun, 3 Apr 2011 12:00:10 +0000 (14:00 +0200)]
m68k: bitops - Never step beyond the end of the bitmap

find_next bitops on m68k (find_next_zero_bit, find_next_bit, and
find_next_bit_le) may cause out of bounds memory access
when the bitmap size in bits % 32 != 0 and offset (the bitnumber
to start searching at) is very close to the bitmap size.

For example,

       unsigned long bitmap[2] = { 0, 0 };
       find_next_bit(bitmap, 63, 62);

1. find_next_bit() tries to find any set bits in bitmap[1],
   but no bits set.

2. Then find_first_bit(bimap + 2, -1)

3. Unfortunately find_first_bit() takes unsigned int as the size argument.

4. find_first_bit will access bitmap[2~] until it find any set bits.

Add missing tests for stepping beyond the end of the bitmap to all
find_{first,next}_*() functions, and make sure they never return a value
larger than the bitmap size.

Reported-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: bitops - offset == ((long)p - (long)vaddr) * 8
Geert Uytterhoeven [Sun, 3 Apr 2011 11:32:00 +0000 (13:32 +0200)]
m68k: bitops - offset == ((long)p - (long)vaddr) * 8

Hence use "offset" in find_next_{,zero_}bit(), like is already done for
find_next_{,zero_}bit_le()

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agodrivers/xen/sys-hypervisor: Cleanup code/data sections definitions
Daniel Kiper [Wed, 4 May 2011 18:19:49 +0000 (20:19 +0200)]
drivers/xen/sys-hypervisor: Cleanup code/data sections definitions

Cleanup code/data sections definitions
accordingly to include/linux/init.h.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoarch/x86/xen/smp: Cleanup code/data sections definitions
Daniel Kiper [Wed, 4 May 2011 18:18:05 +0000 (20:18 +0200)]
arch/x86/xen/smp: Cleanup code/data sections definitions

Cleanup code/data sections definitions
accordingly to include/linux/init.h.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoarch/x86/xen/time: Cleanup code/data sections definitions
Daniel Kiper [Wed, 4 May 2011 18:18:45 +0000 (20:18 +0200)]
arch/x86/xen/time: Cleanup code/data sections definitions

Cleanup code/data sections definitions
accordingly to include/linux/init.h.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoarch/x86/xen/xen-ops: Cleanup code/data sections definitions
Daniel Kiper [Wed, 4 May 2011 18:19:15 +0000 (20:19 +0200)]
arch/x86/xen/xen-ops: Cleanup code/data sections definitions

Cleanup code/data sections definitions
accordingly to include/linux/init.h.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoarch/x86/xen/mmu: Cleanup code/data sections definitions
Daniel Kiper [Thu, 12 May 2011 21:19:53 +0000 (17:19 -0400)]
arch/x86/xen/mmu: Cleanup code/data sections definitions

Cleanup code/data sections definitions
accordingly to include/linux/init.h.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
[v1: Rebased on top of latest linus's to include fixes in mmu.c]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years ago[CIFS] Remove sparse warning
Steve French [Mon, 14 Mar 2011 19:01:59 +0000 (19:01 +0000)]
[CIFS] Remove sparse warning

Move extern for cifsConvertToUCS to different header to prevent following warning:

CHECK   fs/cifs/cifs_unicode.c
fs/cifs/cifs_unicode.c:267:1: warning: symbol 'cifsConvertToUCS' was not declared. Should it be static?

Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years ago[CIFS] Update cifs to version 1.72
Steve French [Wed, 18 May 2011 18:08:28 +0000 (18:08 +0000)]
[CIFS] Update cifs to version 1.72

Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Change key name to cifs.idmap, misc. clean-up
Shirish Pargaonkar [Fri, 6 May 2011 07:35:00 +0000 (02:35 -0500)]
cifs: Change key name to cifs.idmap, misc. clean-up

Change idmap key name from cifs.cifs_idmap to cifs.idmap.
Removed unused structure wksidarr and function match_sid().
Handle errors correctly in function init_cifs().

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Unconditionally copy mount options to superblock info
Sean Finney [Mon, 11 Apr 2011 13:19:35 +0000 (13:19 +0000)]
cifs: Unconditionally copy mount options to superblock info

Previously mount options were copied and updated in the cifs_sb_info
struct only when CONFIG_CIFS_DFS_UPCALL was enabled.  Making this
information generally available allows us to remove a number of ifdefs,
extra function params, and temporary variables.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Use kstrndup for cifs_sb->mountdata
Sean Finney [Mon, 11 Apr 2011 13:19:34 +0000 (13:19 +0000)]
cifs: Use kstrndup for cifs_sb->mountdata

A relatively minor nit, but also clarified the "consensus" from the
preceding comments that it is in fact better to try for the kstrdup
early and cleanup while cleaning up is still a simple thing to do.

Reviewed-By: Steve French <smfrench@gmail.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Simplify handling of submount options in cifs_mount.
Sean Finney [Mon, 11 Apr 2011 13:19:33 +0000 (13:19 +0000)]
cifs: Simplify handling of submount options in cifs_mount.

With CONFIG_DFS_UPCALL enabled, maintain the submount options in
cifs_sb->mountdata, simplifying the code just a bit as well as making
corner-case allocation problems less likely.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: cifs_parse_mount_options: do not tokenize mount options in-place
Sean Finney [Mon, 11 Apr 2011 13:19:32 +0000 (13:19 +0000)]
cifs: cifs_parse_mount_options: do not tokenize mount options in-place

To keep strings passed to cifs_parse_mount_options re-usable (which is
needed to clean up the DFS referral handling), tokenize a copy of the
mount options instead.  If values are needed from this tokenized string,
they too must be duplicated (previously, some options were copied and
others duplicated).

Since we are not on the critical path and any cleanup is relatively easy,
the extra memory usage shouldn't be a problem (and it is a bit simpler
than trying to implement something smarter).

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Add support for mounting Windows 2008 DFS shares
Sean Finney [Mon, 11 Apr 2011 13:19:31 +0000 (13:19 +0000)]
cifs: Add support for mounting Windows 2008 DFS shares

Windows 2008 CIFS servers do not always return PATH_NOT_COVERED when
attempting to access a DFS share.  Therefore, when checking for remote
shares, unconditionally ask for a DFS referral for the UNC (w/out prepath)
before continuing with previous behavior of attempting to access the UNC +
prepath and checking for PATH_NOT_COVERED.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=31092

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Extract DFS referral expansion logic to separate function
Sean Finney [Mon, 11 Apr 2011 13:19:30 +0000 (13:19 +0000)]
cifs: Extract DFS referral expansion logic to separate function

The logic behind the expansion of DFS referrals is now extracted from
cifs_mount into a new static function, expand_dfs_referral.  This will
reduce duplicate code in upcoming commits.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: turn BCC into a static inlined function
Jeff Layton [Fri, 1 Apr 2011 01:18:15 +0000 (21:18 -0400)]
cifs: turn BCC into a static inlined function

It's a bad idea to have macro functions that reference variables more
than once, as the arguments could have side effects. Turn BCC() into
a static inlined function instead.

While we're at it, make it return a void * to discourage anyone from
dereferencing it as-is.

Reported-and-acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: keep BCC in little-endian format
Jeff Layton [Wed, 4 May 2011 12:05:26 +0000 (08:05 -0400)]
cifs: keep BCC in little-endian format

This is the same patch as originally posted, just with some merge
conflicts fixed up...

Currently, the ByteCount is usually converted to host-endian on receive.
This is confusing however, as we need to keep two sets of routines for
accessing it, and keep track of when to use each routine. Munging
received packets like this also limits when the signature can be
calulated.

Simplify the code by keeping the received ByteCount in little-endian
format. This allows us to eliminate a set of routines for accessing it
and we can now drop the *_le suffixes from the accessor functions since
that's now implied.

While we're at it, switch all of the places that read the ByteCount
directly to use the get_bcc inline which should also clean up some
unaligned accesses.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: fix some unused variable warnings in id_rb_search
Jeff Layton [Wed, 4 May 2011 12:08:19 +0000 (08:08 -0400)]
cifs: fix some unused variable warnings in id_rb_search

fs/cifs/cifsacl.c: In function ‘id_rb_search’:
fs/cifs/cifsacl.c:215:19: warning: variable ‘linkto’ set but not used
[-Wunused-but-set-variable]
fs/cifs/cifsacl.c:214:18: warning: variable ‘parent’ set but not used
[-Wunused-but-set-variable]

Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Simplify invalidate part (try #5)
Pavel Shilovsky [Thu, 7 Apr 2011 14:18:11 +0000 (18:18 +0400)]
CIFS: Simplify invalidate part (try #5)

Simplify many places when we call cifs_revalidate/invalidate to make
it do what it exactly needs.

Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: directio read/write cleanups
Pavel Shilovsky [Thu, 10 Mar 2011 07:11:05 +0000 (10:11 +0300)]
CIFS: directio read/write cleanups

Recently introduced strictcache mode brought a new code that can be
efficiently used by directio part. That's let us add vectored operations
and break unnecessary cifs_user_read and cifs_user_write.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoconsistently use smb_buf_length as be32 for cifs (try 3)
Steve French [Fri, 29 Apr 2011 05:40:20 +0000 (05:40 +0000)]
consistently use smb_buf_length as be32 for cifs (try 3)

       There is one big endian field in the cifs protocol, the RFC1001
       length, which cifs code (unlike in the smb2 code) had been handling as
       u32 until the last possible moment, when it was converted to be32 (its
       native form) before sending on the wire.   To remove the last sparse
       endian warning, and to make this consistent with the smb2
       implementation  (which always treats the fields in their
       native size and endianness), convert all uses of smb_buf_length to
       be32.

       This version incorporates Christoph's comment about
       using be32_add_cpu, and fixes a typo in the second
       version of the patch.

Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Invoke id mapping functions (try #17 repost)
Shirish Pargaonkar [Fri, 22 Apr 2011 17:09:36 +0000 (12:09 -0500)]
cifs: Invoke id mapping functions (try #17 repost)

rb tree search and insertion routines.

A SID which needs to be mapped, is looked up in one of the rb trees
depending on whether SID is either owner or group SID.
If found in the tree, a (mapped) id from that node is assigned to
uid or gid as appropriate.  If unmapped, an upcall is attempted to
map the SID to an id.  If upcall is successful, node is marked as
mapped.  If upcall fails, node stays marked as unmapped and a mapping
is attempted again only after an arbitrary time period has passed.

To map a SID, which can be either a Owner SID or a Group SID, key
description starts with the string "os" or "gs" followed by SID converted
to a string. Without "os" or "gs", cifs.upcall does not know whether
SID needs to be mapped to either an uid or a gid.

Nodes in rb tree have fields to prevent multiple upcalls for
a SID.  Searching, adding, and removing nodes is done within global locks.
Whenever a node is either found or inserted in a tree, a reference
is taken on that node.
Shrinker routine prunes a node if it has expired but does not prune
an expired node if its refcount is not zero (i.e. sid/id of that node
is_being/will_be accessed).
Thus a node, if its SID needs to be mapped by making an upcall,
can safely stay and its fields accessed without shrinker pruning it.
A reference (refcount) is put on the node without holding the spinlock
but a reference is get on the node by holding the spinlock.

Every time an existing mapped node is accessed or mapping is attempted,
its timestamp is updated to prevent it from getting erased or a
to prevent multiple unnecessary repeat mapping retries respectively.

For now, cifs.upcall is only used to map a SID to an id (uid or gid) but
it would be used to obtain an SID for an id.

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Add idmap key and related data structures and functions (try #17 repost)
Shirish Pargaonkar [Thu, 28 Apr 2011 04:34:35 +0000 (23:34 -0500)]
cifs: Add idmap key and related data structures and functions (try #17 repost)

Define (global) data structures to store ids, uids and gids, to which a
SID maps.  There are two separate trees, one for SID/uid and another one
for SID/gid.

A new type of key, cifs_idmap_key_type, is used.

Keys are instantiated and searched using credential of the root by
overriding and restoring the credentials of the caller requesting the key.

Id mapping functions are invoked under config option of cifs acl.

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Add launder_page operation (try #3)
Pavel Shilovsky [Fri, 8 Apr 2011 01:29:10 +0000 (05:29 +0400)]
CIFS: Add launder_page operation (try #3)

Add this let us drop filemap_write_and_wait from cifs_invalidate_mapping
and simplify the code to properly process invalidate logic.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoIntroduce smb2 mounts as vers=2
Steve French [Thu, 24 Feb 2011 18:07:19 +0000 (18:07 +0000)]
Introduce smb2 mounts as vers=2

As with Linux nfs client, which uses "nfsvers=" or "vers=" to
indicate which protocol to use for mount, specifying

"vers=smb2" or "vers=2"

will force an smb2 mount. When vers is not specified cifs is used

ie "vers=cifs" or "vers=1"

We can eventually autonegotiate down from smb2 to cifs
when smb2 is stable enough to make it the default, but this
is for the future.  At that time we could also implement a
"maxprotocol" mount option as smbclient and Samba have today,
but that would be premature until smb2 is stable.

Intially the smb2 Kconfig option will depend on "BROKEN"
until the merge is complete, and then be "EXPERIMENTAL"
When it is no longer experimental we can consider changing
the default protocol to attempt first.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Use invalidate_inode_pages2 instead of invalidate_remote_inode (try #4)
Pavel Shilovsky [Tue, 15 Mar 2011 22:55:32 +0000 (01:55 +0300)]
CIFS: Use invalidate_inode_pages2 instead of invalidate_remote_inode (try #4)

Use invalidate_inode_pages2 that don't leave pages even if shrink_page_list()
has a temp ref on them. It prevents a data coherency problem when
cifs_invalidate_mapping didn't invalidate pages but the client thinks that a data
from the cache is uptodate according to an oplock level (exclusive or II).

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: fix comment in validate_t2
Jeff Layton [Thu, 31 Mar 2011 21:22:07 +0000 (17:22 -0400)]
cifs: fix comment in validate_t2

The comment about checking the bcc is in the wrong place. Also make it
match kernel coding style.

Reported-and-acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoVFS: trivial: fix comment on s_maxbytes value warning check
Jeff Layton [Tue, 29 Mar 2011 13:33:31 +0000 (09:33 -0400)]
VFS: trivial: fix comment on s_maxbytes value warning check

I originally intended to remove this warning in 2.6.34, but it's not in
a high performance codepath and might help us to catch bugs later. Let's
keep it, but fix the comment to allay confusion about its removal.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years ago[CIFS] Allow to set extended attribute cifs_acl (try #2)
Steve French [Tue, 19 Apr 2011 18:27:10 +0000 (18:27 +0000)]
[CIFS] Allow to set extended attribute cifs_acl (try #2)

Allow setting cifs_acl on the server.
Pass on to the server the ACL blob generated by an application.
cifs is just a pass-through, it does not monitor or inspect the contents
of the blob, server decides whether to enforce/apply the ACL blob composed
by an application.
If setting of ACL is succeessful, mark the inode for revalidation.

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years ago[CIFS] Use ecb des kernel crypto APIs instead of
Steve French [Tue, 19 Apr 2011 18:23:31 +0000 (18:23 +0000)]
[CIFS] Use ecb des kernel crypto APIs instead of
 local cifs functions (repost)

Using kernel crypto APIs for DES encryption during LM and NT hash generation
instead of local functions within cifs.
Source file smbdes.c is deleted sans four functions, one of which
uses ecb des functionality provided by kernel crypto APIs.

Remove function SMBOWFencrypt.

Add return codes to various functions such as calc_lanman_hash,
SMBencrypt, and SMBNTencrypt.  Includes fix noticed by Dan Carpenter.

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
CC: Dan Carpenter <error27@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: cleanup: Rename and remove config flags
Shirish Pargaonkar [Fri, 25 Feb 2011 16:48:55 +0000 (10:48 -0600)]
cifs: cleanup: Rename and remove config flags

Remove config flag CIFS_EXPERIMENTAL.
Do export operations under new config flag CIFS_NFSD_EXPORT

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoIntroduce SMB2 Kconfig option
Steve French [Thu, 24 Feb 2011 17:58:00 +0000 (17:58 +0000)]
Introduce SMB2 Kconfig option

SMB2 is the followon to the CIFS (and SMB) protocols
and the default for Windows since Windows Vista, and also
now implemented by various non-Windows servers.  SMB2
is more secure, has various performance advantages, including
larger i/o sizes, flow control, better caching model and more.
SMB2 also resolves some scalability limits in the cifs
protocol and adds many new features while being much
simpler (only a few dozen commands instead of hundreds)
and since the protocol is clearer it is
also more consistently implemented across servers
and thus easier to optimize.

After much discussion with Jeff Layton, Jeremy Allison
and others at Connectathon, we decided to move the smb2
code from a distinct .ko and fstype into distinct
C files that optionally build in cifs.ko.  As a result
the Kconfig gets simpler.

To avoid destabilizing cifs, the smb2 code is going
to be moved into its own experimental CONFIG_CIFS_SMB2 ifdef
as it is merged and rereviewed.  The changes to stable
cifs (builds with the smb2 ifdef off) are expected to be
fairly small.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoShrink stack space usage in cifs_construct_tcon
Steve French [Tue, 1 Mar 2011 05:02:57 +0000 (05:02 +0000)]
Shrink stack space usage in cifs_construct_tcon

We were reserving MAX_USERNAME (now 256) on stack for
something which only needs to fit about 24 bytes ie
string krb50x +  printf version of uid

Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agofs:cifs:connect.c remove one to many l's in the word.
Justin P. Mattock [Fri, 25 Feb 2011 06:15:02 +0000 (22:15 -0800)]
fs:cifs:connect.c remove one to many l's in the word.

The patch below removes an extra "l" in the word.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoDon't compile in unused reparse point symlink code
Steve French [Thu, 24 Feb 2011 06:16:22 +0000 (06:16 +0000)]
Don't compile in unused reparse point symlink code

Recent Windows versions now create symlinks more frequently
and they do use this "reparse point" symlink mechanism.  We can of course
do symlinks nicely to Samba and other servers which support the
CIFS Unix Extensions and we can also do SFU symlinks and "client only"
"MF" symlinks optionally, but for recent Windows we currently can not
handle the common "reparse point" symlinks fully, removing the caller
for this. We will need to extend and reenable this "reparse point" worker
code in cifs and fix cifs_symlink to call this.  In the interim this code
has been moved to its own config option so it is not compiled in by default
until cifs_symlink fixed up (and tested) to use this.

CC: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoRemove unused CIFSSMBNotify worker function
Steve French [Thu, 24 Feb 2011 05:39:23 +0000 (05:39 +0000)]
Remove unused CIFSSMBNotify worker function

The CIFSSMBNotify worker is unused, pending changes to allow it to be called
via inotify, so move it into its own experimental config option so it does
not get built in, until the necessary VFS support is fixed.  It used to
be used in dnotify, but according to Jeff, inotify needs minor changes
before we can reenable this.

CC: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agocifs: Remove unused inode number while fetching root inode
Shirish Pargaonkar [Tue, 22 Feb 2011 05:56:59 +0000 (23:56 -0600)]
cifs: Remove unused inode number while fetching root inode

ino is unused in function cifs_root_iget().

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>