]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:43:09 +0000 (11:43 +1000)]
Merge remote-tracking branch 'crypto/master'

9 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:41:43 +0000 (11:41 +1000)]
Merge remote-tracking branch 'bluetooth/master'

Conflicts:
net/bluetooth/hci_conn.c
net/bluetooth/smp.c

9 years agoMerge remote-tracking branch 'wireless-next/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:39:36 +0000 (11:39 +1000)]
Merge remote-tracking branch 'wireless-next/master'

9 years agoMerge remote-tracking branch 'net-next/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:27:49 +0000 (11:27 +1000)]
Merge remote-tracking branch 'net-next/master'

9 years agoMerge remote-tracking branch 'dmaengine/next'
Stephen Rothwell [Fri, 27 Jun 2014 01:26:48 +0000 (11:26 +1000)]
Merge remote-tracking branch 'dmaengine/next'

9 years agoMerge remote-tracking branch 'swiotlb/linux-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:25:34 +0000 (11:25 +1000)]
Merge remote-tracking branch 'swiotlb/linux-next'

9 years agoMerge remote-tracking branch 'ieee1394/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:25:29 +0000 (11:25 +1000)]
Merge remote-tracking branch 'ieee1394/for-next'

9 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:23:42 +0000 (11:23 +1000)]
Merge remote-tracking branch 'pm/linux-next'

9 years agoMerge remote-tracking branch 'libata/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:22:44 +0000 (11:22 +1000)]
Merge remote-tracking branch 'libata/for-next'

9 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:21:23 +0000 (11:21 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

9 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:20:06 +0000 (11:20 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

9 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:19:06 +0000 (11:19 +1000)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

9 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:17:54 +0000 (11:17 +1000)]
Merge remote-tracking branch 'hid/for-next'

9 years agoMerge remote-tracking branch 'vfs/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:11:25 +0000 (11:11 +1000)]
Merge remote-tracking branch 'vfs/for-next'

9 years agoMerge remote-tracking branch 'xfs/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:10:20 +0000 (11:10 +1000)]
Merge remote-tracking branch 'xfs/for-next'

9 years agoMerge remote-tracking branch 'nfs/linux-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:08:40 +0000 (11:08 +1000)]
Merge remote-tracking branch 'nfs/linux-next'

9 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:06:47 +0000 (11:06 +1000)]
Merge remote-tracking branch 'logfs/master'

9 years agoMerge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:05:49 +0000 (11:05 +1000)]
Merge remote-tracking branch 'gfs2/master'

9 years agoMerge remote-tracking branch 'fscache/fscache'
Stephen Rothwell [Fri, 27 Jun 2014 01:05:40 +0000 (11:05 +1000)]
Merge remote-tracking branch 'fscache/fscache'

9 years agoMerge remote-tracking branch 'f2fs/dev'
Stephen Rothwell [Fri, 27 Jun 2014 01:04:46 +0000 (11:04 +1000)]
Merge remote-tracking branch 'f2fs/dev'

9 years agoMerge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Fri, 27 Jun 2014 01:03:38 +0000 (11:03 +1000)]
Merge remote-tracking branch 'ext4/dev'

9 years agoMerge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Fri, 27 Jun 2014 01:02:37 +0000 (11:02 +1000)]
Merge remote-tracking branch 'ecryptfs/next'

9 years agoMerge remote-tracking branch 'cifs/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 01:01:38 +0000 (11:01 +1000)]
Merge remote-tracking branch 'cifs/for-next'

9 years agoMerge remote-tracking branch 'ceph/master'
Stephen Rothwell [Fri, 27 Jun 2014 01:00:17 +0000 (11:00 +1000)]
Merge remote-tracking branch 'ceph/master'

9 years agoMerge remote-tracking branch 'uml/next'
Stephen Rothwell [Fri, 27 Jun 2014 00:59:14 +0000 (10:59 +1000)]
Merge remote-tracking branch 'uml/next'

Conflicts:
arch/um/include/asm/Kbuild

9 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Fri, 27 Jun 2014 00:58:17 +0000 (10:58 +1000)]
Merge remote-tracking branch 'tile/master'

9 years agoMerge remote-tracking branch 'fsl/next'
Stephen Rothwell [Fri, 27 Jun 2014 00:57:12 +0000 (10:57 +1000)]
Merge remote-tracking branch 'fsl/next'

9 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:48:18 +0000 (10:48 +1000)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

9 years agoMerge remote-tracking branch 'metag/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:47:23 +0000 (10:47 +1000)]
Merge remote-tracking branch 'metag/for-next'

9 years agoMerge remote-tracking branch 'm68knommu/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:46:30 +0000 (10:46 +1000)]
Merge remote-tracking branch 'm68knommu/for-next'

9 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:44:56 +0000 (10:44 +1000)]
Merge remote-tracking branch 'tegra/for-next'

9 years agoMerge remote-tracking branch 'sunxi/sunxi/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:43:57 +0000 (10:43 +1000)]
Merge remote-tracking branch 'sunxi/sunxi/for-next'

9 years agoMerge remote-tracking branch 'samsung/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:43:04 +0000 (10:43 +1000)]
Merge remote-tracking branch 'samsung/for-next'

9 years agoMerge remote-tracking branch 'renesas/next'
Stephen Rothwell [Fri, 27 Jun 2014 00:42:11 +0000 (10:42 +1000)]
Merge remote-tracking branch 'renesas/next'

9 years agoMerge remote-tracking branch 'mvebu/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:41:12 +0000 (10:41 +1000)]
Merge remote-tracking branch 'mvebu/for-next'

Conflicts:
arch/arm/mach-mvebu/Kconfig

9 years agoMerge remote-tracking branch 'imx-mxs/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:40:02 +0000 (10:40 +1000)]
Merge remote-tracking branch 'imx-mxs/for-next'

Conflicts:
arch/arm/mach-imx/Kconfig

9 years agoMerge remote-tracking branch 'ep93xx/ep93xx-for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:39:50 +0000 (10:39 +1000)]
Merge remote-tracking branch 'ep93xx/ep93xx-for-next'

9 years agoMerge remote-tracking branch 'berlin/berlin/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:38:52 +0000 (10:38 +1000)]
Merge remote-tracking branch 'berlin/berlin/for-next'

9 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:37:52 +0000 (10:37 +1000)]
Merge remote-tracking branch 'arm/for-next'

9 years agoMerge remote-tracking branch 'arc/for-next'
Stephen Rothwell [Fri, 27 Jun 2014 00:37:00 +0000 (10:37 +1000)]
Merge remote-tracking branch 'arc/for-next'

9 years agoMerge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:17 +0000 (10:35 +1000)]
Merge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'

9 years agoMerge remote-tracking branch 'ide/master'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:08 +0000 (10:35 +1000)]
Merge remote-tracking branch 'ide/master'

9 years agoMerge remote-tracking branch 'crypto-current/master'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:07 +0000 (10:35 +1000)]
Merge remote-tracking branch 'crypto-current/master'

9 years agoMerge remote-tracking branch 'input-current/for-linus'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:05 +0000 (10:35 +1000)]
Merge remote-tracking branch 'input-current/for-linus'

9 years agoMerge remote-tracking branch 'usb-serial-fixes/usb-linus'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:04 +0000 (10:35 +1000)]
Merge remote-tracking branch 'usb-serial-fixes/usb-linus'

9 years agoMerge remote-tracking branch 'usb.current/usb-linus'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:03 +0000 (10:35 +1000)]
Merge remote-tracking branch 'usb.current/usb-linus'

9 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:02 +0000 (10:35 +1000)]
Merge remote-tracking branch 'wireless/master'

9 years agoMerge remote-tracking branch 'pci-current/for-linus'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:01 +0000 (10:35 +1000)]
Merge remote-tracking branch 'pci-current/for-linus'

9 years agoMerge remote-tracking branch 'sound-current/for-linus'
Stephen Rothwell [Fri, 27 Jun 2014 00:35:00 +0000 (10:35 +1000)]
Merge remote-tracking branch 'sound-current/for-linus'

9 years agoMerge branch 'for-3.17/upstream' into for-next
Jiri Kosina [Thu, 26 Jun 2014 22:34:05 +0000 (00:34 +0200)]
Merge branch 'for-3.17/upstream' into for-next

9 years agoHID: roccat: Drop cast
Himangi Saraogi [Thu, 26 Jun 2014 17:28:52 +0000 (22:58 +0530)]
HID: roccat: Drop cast

This patch removes the cast on data of type void* as it is not needed.
The following Coccinelle semantic patch was used for making the change:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Thu, 26 Jun 2014 20:06:13 +0000 (13:06 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A small collection of fixes/changes for the current series.  This
  contains:

   - Removal of dead code from Gu Zheng.

   - Revert of two bad fixes that went in earlier in this round, marking
     things as __init that were not purely used from init.

   - A fix for blk_mq_start_hw_queue() using the __blk_mq_run_hw_queue(),
     which could place us wrongly.  Make it use the non __ variant,
     which handles cases where we are called from the wrong CPU set.
     From me.

   - A fix for drbd, which allocates discard requests without room for
     the SCSI payload.  From Lars Ellenberg.

   - A fix for user-after-free in the blkcg code from Tejun.

   - Addition of limiting gaps in SG lists, if the hardware needs it.
     This is the last pre-req patch for blk-mq to enable the full NVMe
     conversion.  Could wait until 3.17, but it's simple enough so would
     be nice to have everything we need for the NVMe port in the 3.17
     release.  From me"

* 'for-linus' of git://git.kernel.dk/linux-block:
  drbd: fix NULL pointer deref in blk_add_request_payload
  blk-mq: blk_mq_start_hw_queue() should use blk_mq_run_hw_queue()
  block: add support for limiting gaps in SG lists
  bio: remove unused macro bip_vec_idx()
  Revert "block: add __init to elv_register"
  Revert "block: add __init to blkcg_policy_register"
  blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t
  floppy: format block0 read error message properly

9 years agoFix 32-bit regression in block device read(2)
Al Viro [Mon, 23 Jun 2014 07:44:40 +0000 (08:44 +0100)]
Fix 32-bit regression in block device read(2)

blkdev_read_iter() wants to cap the iov_iter by the amount of data
remaining to the end of device.  That's what iov_iter_truncate() is for
(trim iter->count if it's above the given limit).  So far, so good, but
the argument of iov_iter_truncate() is size_t, so on 32bit boxen (in
case of a large device) we end up with that upper limit truncated down
to 32 bits *before* comparing it with iter->count.

Easily fixed by making iov_iter_truncate() take 64bit argument - it does
the right thing after such change (we only reach the assignment in there
when the current value of iter->count is greater than the limit, i.e.
for anything that would get truncated we don't reach the assignment at
all) and that argument is not the new value of iter->count - it's an
upper limit for such.

The overhead of passing u64 is not an issue - the thing is inlined, so
callers passing size_t won't pay any penalty.

Reported-and-tested-by: Theodore Tso <tytso@mit.edu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Tested-by: Bruno Wolff III <bruno@wolff.to>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoclk: flatten clk tree in debugfs
Peter De Schrijver [Fri, 30 May 2014 15:03:57 +0000 (18:03 +0300)]
clk: flatten clk tree in debugfs

This patch flattens the clk tree in CCF debugfs. Instead of representing the
clocks and their hierarchy as a directory structure under
/sys/kernel/debug/clk, each clock gets a single directory directly under
/sys/kernel/debug/clk. The orphans directory is replaced by a file called
clk_orphan_summary.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
9 years agoclkdev: Don't print errors on probe defer
Stephen Boyd [Fri, 13 Jun 2014 23:36:31 +0000 (16:36 -0700)]
clkdev: Don't print errors on probe defer

This error message can spam the logs if you have lots of probe
deferals due to missing clocks. Just silence the error in this
case because the driver should try again later.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
9 years agorcu: Fix a sparse warning in rcu_report_unblock_qs_rnp()
Pranith Kumar [Wed, 11 Jun 2014 20:39:41 +0000 (16:39 -0400)]
rcu: Fix a sparse warning in rcu_report_unblock_qs_rnp()

This commit annotates rcu_report_unblock_qs_rnp() in order to fix the
following sparse warning:

kernel/rcu/tree_plugin.h:990:13: warning: context imbalance in 'rcu_report_unblock_qs_rnp' - unexpected unlock

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Fix a sparse warning in rcu_initiate_boost()
Pranith Kumar [Wed, 11 Jun 2014 20:39:40 +0000 (16:39 -0400)]
rcu: Fix a sparse warning in rcu_initiate_boost()

This commit annotates rcu_initiate_boost() fixes the following sparse
warning:

kernel/rcu/tree_plugin.h:1494:13: warning: context imbalance in 'rcu_initiate_boost' - unexpected unlock

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agoMerge branch 'patchwork' into to_next
Mauro Carvalho Chehab [Thu, 26 Jun 2014 19:19:53 +0000 (16:19 -0300)]
Merge branch 'patchwork' into to_next

* patchwork: (11415 commits)
  [media] technisat-sub2: Fix stream curruption on high bitrate
  [media] au0828: don't hardcode height/width
  [media] au0828: Only alt setting logic when needed
  [media] au0828/au8522: Add PAL-M support
  [media] au8522: Fix demod analog mode setting
  [media] au8522: cleanup s-video settings at setup_decoder_defaults()
  [media] au8522: be sure that we'll setup audio routing at the right time
  [media] au8522: be sure that the setup will happen at streamon time
  [media] au8522: move input_mode out one level
  [media] au0828: add missing tuner Kconfig dependency
  [media] rc: img-ir: Expand copyright headers with GPL notices
  [media] V4L2: soc_camera: Add run-time dependencies to sh_mobile drivers
  [media] media: mx2_camera: Change Kconfig dependency
  [media] media: mx1_camera: Remove driver
  [media] V4L2: soc_camera: add run-time dependencies to R-Car VIN driver
  [media] rcar_vin: copy flags from pdata
  [media] V4L: soc-camera: explicitly free allocated managed memory on error
  [media] dib7000p: Callibrate signal strength
  [media] dib7000p: Add DVBv5 stats support
  [media] dib8000: export just one symbol
  ...

9 years agoMerge branch 'v4l_for_linus' into to_next
Mauro Carvalho Chehab [Thu, 26 Jun 2014 19:19:44 +0000 (16:19 -0300)]
Merge branch 'v4l_for_linus' into to_next

* v4l_for_linus:
  [media] saa7134: use unlocked_ioctl instead of ioctl
  [media] media: v4l2-core: v4l2-dv-timings.c: Cleaning up code wrong value used in aspect ratio
  [media] si2168: firmware download fix
  [media] si2157: add one missing parenthesis
  [media] si2168: add one missing parenthesis
  [media] staging: tighten omap4iss dependencies
  [media] au0828-dvb: restore its permission to 644

9 years agosb_edac: add support for Haswell based systems
Aristeu Rozanski [Fri, 20 Jun 2014 13:27:54 +0000 (10:27 -0300)]
sb_edac: add support for Haswell based systems

Haswell memory controllers are very similar to Ivy Bridge and Sandy Bridge
ones. This patch adds support to Haswell based systems.

[m.chehab@samsung.com: Fix CodingStyle issues]
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: Fix mix tab/spaces alignments
Mauro Carvalho Chehab [Thu, 26 Jun 2014 18:35:14 +0000 (15:35 -0300)]
sb_edac: Fix mix tab/spaces alignments

We should not have spaces before ^I on alignments.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoedac: add DDR4 and RDDR4
Aristeu Rozanski [Wed, 18 Jun 2014 14:05:01 +0000 (11:05 -0300)]
edac: add DDR4 and RDDR4

Haswell memory controller can make use of DDR4 and Registered DDR4

Cc: tony.luck@intel.com
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: remove bogus assumption on mc ordering
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:29 +0000 (15:15 -0300)]
sb_edac: remove bogus assumption on mc ordering

When a MC is handled, the correct sbridge_dev is searched based on the node,
checking again later with the assumption the first memory controller found is
the first socket's memory controller is a bogus assumption. Get rid of it.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: make minimal use of channel_mask
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:28 +0000 (15:15 -0300)]
sb_edac: make minimal use of channel_mask

channel_mask will be used in the future to determine which group of memory
modules is causing the errors since when mirroring, lockstep and close page
are enabled you can't. While that doesn't happen, use the channel_mask to
determine the channel instead of relying on the MC event/exception.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: fix socket detection on Ivy Bridge controllers
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:27 +0000 (15:15 -0300)]
sb_edac: fix socket detection on Ivy Bridge controllers

This patch fixes the obvious bug while handling the socket/HA bitmask used in
Ivy Bridge memory controllers.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: update Kconfig description
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:26 +0000 (15:15 -0300)]
sb_edac: update Kconfig description

Kconfig wasn't updated when Ivy Bridge support was added.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: search devices using product id
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:25 +0000 (15:15 -0300)]
sb_edac: search devices using product id

This patch changes the way devices are searched by using product id instead of
device/function numbers. Tested in a Sandy Bridge and a Ivy Bridge machine to
make sure everything works properly.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: make RIR limit retrieval per model
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:24 +0000 (15:15 -0300)]
sb_edac: make RIR limit retrieval per model

Haswell has a different way to retrieve RIR limits, make this procedure per
model.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: make node id retrieval per model
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:23 +0000 (15:15 -0300)]
sb_edac: make node id retrieval per model

Haswell has a different way to retrieve the node id, make so this procedure
can be reimplemented.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agosb_edac: make memory type detection per memory controller
Aristeu Rozanski [Mon, 2 Jun 2014 18:15:22 +0000 (15:15 -0300)]
sb_edac: make memory type detection per memory controller

Haswell has different register, offset to determine memory type and supports
DDR4 in some models. This patch makes it easier to have a different method
depending on the memory controller type.

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agorcu: Fix __rcu_reclaim() to use true/false for bool
Paul E. McKenney [Mon, 23 Jun 2014 20:48:28 +0000 (13:48 -0700)]
rcu: Fix __rcu_reclaim() to use true/false for bool

The __rcu_reclaim() function returned 0/1, which is not proper for a
function of type bool.  This commit therefore converts to false/true.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: remove CONFIG_PROVE_RCU_DELAY
Paul E. McKenney [Mon, 23 Jun 2014 19:09:52 +0000 (12:09 -0700)]
rcu: remove CONFIG_PROVE_RCU_DELAY

The CONFIG_PROVE_RCU_DELAY Kconfig parameter doesn't appear to be very
effective at finding race conditions, so this commit removes it.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
9 years agodocumentation: Add pointer to percpu-ref for RCU and refcount
Paul E. McKenney [Mon, 23 Jun 2014 18:52:59 +0000 (11:52 -0700)]
documentation: Add pointer to percpu-ref for RCU and refcount

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Use __this_cpu_read() instead of per_cpu_ptr()
Paul E. McKenney [Thu, 19 Jun 2014 21:12:44 +0000 (14:12 -0700)]
rcu: Use __this_cpu_read() instead of per_cpu_ptr()

The __this_cpu_read() function produces better code than does
per_cpu_ptr() on both ARM and x86.  For example, gcc (Ubuntu/Linaro
4.7.3-12ubuntu1) 4.7.3 produces the following:

ARMv7 per_cpu_ptr():

force_quiescent_state:
    mov    r3, sp    @,
    bic    r1, r3, #8128    @ tmp171,,
    ldr    r2, .L98    @ tmp169,
    bic    r1, r1, #63    @ tmp170, tmp171,
    ldr    r3, [r0, #220]    @ __ptr, rsp_6(D)->rda
    ldr    r1, [r1, #20]    @ D.35903_68->cpu, D.35903_68->cpu
    mov    r6, r0    @ rsp, rsp
    ldr    r2, [r2, r1, asl #2]    @ tmp173, __per_cpu_offset
    add    r3, r3, r2    @ tmp175, __ptr, tmp173
    ldr    r5, [r3, #12]    @ rnp_old, D.29162_13->mynode

ARMv7 __this_cpu_read():

force_quiescent_state:
    ldr    r3, [r0, #220]    @ rsp_7(D)->rda, rsp_7(D)->rda
    mov    r6, r0    @ rsp, rsp
    add    r3, r3, #12    @ __ptr, rsp_7(D)->rda,
    ldr    r5, [r2, r3]    @ rnp_old, *D.29176_13

Using gcc 4.8.2:

x86_64 per_cpu_ptr():

    movl %gs:cpu_number,%edx    # cpu_number, pscr_ret__
    movslq    %edx, %rdx    # pscr_ret__, pscr_ret__
    movq    __per_cpu_offset(,%rdx,8), %rdx    # __per_cpu_offset, tmp93
    movq    %rdi, %r13    # rsp, rsp
    movq    1000(%rdi), %rax    # rsp_9(D)->rda, __ptr
    movq    24(%rdx,%rax), %r12    # _15->mynode, rnp_old

x86_64 __this_cpu_read():

    movq    %rdi, %r13    # rsp, rsp
    movq    1000(%rdi), %rax    # rsp_9(D)->rda, rsp_9(D)->rda
    movq %gs:24(%rax),%r12    # _10->mynode, rnp_old

Because this change produces significant benefits for these two very
diverse architectures, this commit makes this change.

Signed-off-by: Shan Wei <davidshan@tencent.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
9 years agodocumentation: Add acquire/release barriers to pairing rules
Paul E. McKenney [Thu, 19 Jun 2014 17:01:23 +0000 (10:01 -0700)]
documentation: Add acquire/release barriers to pairing rules

It is possible to pair acquire and release barriers with other barriers,
so this commit adds them to the list in the SMP barrier pairing section.

Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
9 years agorcu: Don't use NMIs to dump other CPUs' stacks
Paul E. McKenney [Wed, 18 Jun 2014 16:18:31 +0000 (09:18 -0700)]
rcu: Don't use NMIs to dump other CPUs' stacks

Although NMI-based stack dumps are in principle more accurate, they are
also more likely to trigger deadlocks.  This commit therefore replaces
all uses of trigger_all_cpu_backtrace() with rcu_dump_cpu_stacks(), so
that the CPU detecting an RCU CPU stall does the stack dumping.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Bind grace-period kthreads to non-NO_HZ_FULL CPUs
Paul E. McKenney [Wed, 4 Jun 2014 20:46:03 +0000 (13:46 -0700)]
rcu: Bind grace-period kthreads to non-NO_HZ_FULL CPUs

Binding the grace-period kthreads to the timekeeping CPU resulted in
significant performance decreases for some workloads.  For more detail,
see:

https://lkml.org/lkml/2014/6/3/395 for benchmark numbers

https://lkml.org/lkml/2014/6/4/218 for CPU statistics

It turns out that it is necessary to bind the grace-period kthreads
to the timekeeping CPU only when all but CPU 0 is a nohz_full CPU
on the one hand or if CONFIG_NO_HZ_FULL_SYSIDLE=y on the other.
In other cases, it suffices to bind the grace-period kthreads to the
set of non-nohz_full CPUs.

This commit therefore creates a tick_nohz_not_full_mask that is the
complement of tick_nohz_full_mask, and then binds the grace-period
kthread to the set of CPUs indicated by this new mask, which covers
the CONFIG_NO_HZ_FULL_SYSIDLE=n case.  The CONFIG_NO_HZ_FULL_SYSIDLE=y
case still binds the grace-period kthreads to the timekeeping CPU.
This commit also includes the tick_nohz_full_enabled() check suggested
by Frederic Weisbecker.

Reported-by: Jet Chen <jet.chen@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ paulmck: Created housekeeping_affine() per fweisbec feedback. ]

9 years agorcu: Simplify priority boosting by putting rt_mutex in rcu_node
Paul E. McKenney [Thu, 12 Jun 2014 20:30:25 +0000 (13:30 -0700)]
rcu: Simplify priority boosting by putting rt_mutex in rcu_node

RCU priority boosting currently checks for boosting via a pointer in
task_struct.  However, this is not needed: As Oleg noted, if the
rt_mutex is placed in the rcu_node instead of on the booster's stack,
the boostee can simply check it see if it owns the lock.  This commit
makes this change, shrinking task_struct by one pointer and the kernel
by thirteen lines.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Check both root and current rcu_node when setting up future grace period
Pranith Kumar [Wed, 11 Jun 2014 17:32:47 +0000 (10:32 -0700)]
rcu: Check both root and current rcu_node when setting up future grace period

The rcu_start_future_gp() function checks the current rcu_node's ->gpnum
and ->completed twice, once without ACCESS_ONCE() and once with it.
Which is pointless because we hold that rcu_node's ->lock at that point.
The intent was to check the current rcu_node structure and the root
rcu_node structure, the latter locklessly with ACCESS_ONCE().  This
commit therefore makes that change.

The reason that it is safe to locklessly check the root rcu_nodes's
->gpnum and ->completed fields is that we hold the current rcu_node's
->lock, which constrains the root rcu_node's ability to change its
->gpnum and ->completed fields.  Of course, if there is a single rcu_node
structure, then rnp_root==rnp, and holding the lock prevents all changes.
If there is more than one rcu_node structure, then the code updates the
fields in the following order:

1. Increment rnp_root->gpnum to start new grace period.
2. Increment rnp->gpnum to initialize the current rcu_node,
continuing initialization for the new grace period.
3. Increment rnp_root->completed to end the current grace period.
4. Increment rnp->completed to continue cleaning up after the
old grace period.

So there are four possible combinations of relative values of these
four fields:

N   N   N   N:  RCU idle, new grace period must be initiated.
Although rnp_root->gpnum might be incremented immediately
after we check, that will just result in unnecessary work.
The grace period already started, and we try to start it.

N+1 N   N   N:  RCU grace period just started.  No further change is
possible because we hold rnp->lock, so the checks of
rnp_root->gpnum and rnp_root->completed are stable.
We know that our request for a future grace period will
be seen during grace-period cleanup.

N+1 N   N+1 N:  RCU grace period is ongoing.  Because rnp->gpnum is
different than rnp->completed, we won't even look at
rnp_root->gpnum and rnp_root->completed, so the possible
concurrent change to rnp_root->completed does not matter.
We know that our request for a future grace period will
be seen during grace-period cleanup, which cannot pass
this rcu_node because we hold its ->lock.

N+1 N+1 N+1 N:  RCU grace period has ended, but not yet been cleaned up.
Because rnp->gpnum is different than rnp->completed, we
won't look at rnp_root->gpnum and rnp_root->completed, so
the possible concurrent change to rnp_root->completed does
not matter.  We know that our request for a future grace
period will be seen during grace-period cleanup, which
cannot pass this rcu_node because we hold its ->lock.

Therefore, despite initial appearances, the lockless check is safe.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
[ paulmck: Update comment to say why the lockless check is safe. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Allow post-unlock reference for rt_mutex
Paul E. McKenney [Tue, 10 Jun 2014 23:31:55 +0000 (16:31 -0700)]
rcu: Allow post-unlock reference for rt_mutex

The current approach to RCU priority boosting uses an rt_mutex strictly
for its priority-boosting side effects.  The rt_mutex_init_proxy_locked()
function is used by the booster to initialize the lock as held by the
boostee.  The booster then uses rt_mutex_lock() to acquire this rt_mutex,
which priority-boosts the boostee.  When the boostee reaches the end
of its outermost RCU read-side critical section, it checks a field in
its task structure to see whether it has been boosted, and, if so, uses
rt_mutex_unlock() to release the rt_mutex.  The booster can then go on
to boost the next task that is blocking the current RCU grace period.

But reasonable implementations of rt_mutex_unlock() might result in the
boostee referencing the rt_mutex's data after releasing it.  But the
booster might have re-initialized the rt_mutex between the time that the
boostee released it and the time that it later referenced it.  This is
clearly asking for trouble, so this commit introduces a completion that
forces the booster to wait until the boostee has completely finished with
the rt_mutex, thus avoiding the case where the booster is re-initializing
the rt_mutex before the last boostee's last reference to that rt_mutex.

This of course does introduce some overhead, but the priority-boosting
code paths are miles from any possible fastpath, and the overhead of
executing the completion will normally be quite small compared to the
overhead of priority boosting and deboosting, so this should be OK.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agodocumentation: Update reference, kerneltrap.org no longer works
Pranith Kumar [Mon, 9 Jun 2014 15:51:23 +0000 (11:51 -0400)]
documentation: Update reference, kerneltrap.org no longer works

The kerneltrap.org site no longer works, so this commit updates it to
a working reference, namely gmane.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Loosen __call_rcu()'s rcu_head alignment constraint
Paul E. McKenney [Mon, 9 Jun 2014 15:24:17 +0000 (08:24 -0700)]
rcu: Loosen __call_rcu()'s rcu_head alignment constraint

The m68k architecture aligns only to 16-bit boundaries, which can cause
the align-to-32-bits check in __call_rcu() to trigger.  Because there is
currently no known potential need for more than one low-order bit, this
commit loosens the check to 16-bit boundaries.

Reported-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Update RCU maintainership
Paul E. McKenney [Tue, 3 Jun 2014 15:17:06 +0000 (08:17 -0700)]
rcu: Update RCU maintainership

Drop Dipankar Sarma at his request (https://lkml.org/lkml/2014/6/2/628),
add Josh Triplett based on long-term review, contributions, and
agreement to take on this role (https://lkml.org/lkml/2014/6/2/554).

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Add designated reviewers for RCU
Paul E. McKenney [Fri, 30 May 2014 22:37:24 +0000 (15:37 -0700)]
rcu: Add designated reviewers for RCU

Adding Steven Rostedt, Mathieu Desnoyers, and Lai Jiangshan as designated
RCU reviewers based on recent emails:

o https://lkml.org/lkml/2014/6/2/578 (Steven)
o https://lkml.org/lkml/2014/6/2/621 (Mathieu)
o https://lkml.org/lkml/2014/6/3/897 (Lai)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
9 years agoMAINTAINERS: Add "R:" designated-reviewers tag
Paul E. McKenney [Mon, 2 Jun 2014 16:06:37 +0000 (09:06 -0700)]
MAINTAINERS: Add "R:" designated-reviewers tag

A ksummit-discuss email thread looked at the difficulty recruiting
and retaining reviewers.  Paul Walmsley also noted the need for patch
submitters to know who the key reviewers are and suggested adding an
"R:" tag to the MAINTAINERS file to record this information on a
per-subsystem basis.  This commit does just that, and a subsequent
commit tags the designated reviewer for the RCU-related subsystems.

http://lists.linuxfoundation.org/pipermail/ksummit-discuss/2014-May/000830.html

Suggested-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
9 years agorcu: Eliminate read-modify-write ACCESS_ONCE() calls
Paul E. McKenney [Mon, 2 Jun 2014 21:54:34 +0000 (14:54 -0700)]
rcu: Eliminate read-modify-write ACCESS_ONCE() calls

RCU contains code of the following forms:

ACCESS_ONCE(x)++;
ACCESS_ONCE(x) += y;
ACCESS_ONCE(x) -= y;

Now these constructs do operate correctly, but they really result in a
pair of volatile accesses, one to do the load and another to do the store.
This can be confusing, as the casual reader might well assume that (for
example) gcc might generate a memory-to-memory add instruction for each
of these three cases.  In fact, gcc will do no such thing.  Also, there
is a good chance that the kernel will move to separate load and store
variants of ACCESS_ONCE(), and constructs like the above could easily
confuse both people and scripts attempting to make that sort of change.
Finally, most of RCU's read-modify-write uses of ACCESS_ONCE() really
only need the store to be volatile, so that the read-modify-write form
might be misleading.

This commit therefore changes the above forms in RCU so that each instance
of ACCESS_ONCE() either does a load or a store, but not both.  In a few
cases, ACCESS_ONCE() was not critical, for example, for maintaining
statisitics.  In these cases, ACCESS_ONCE() has been dispensed with
entirely.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Throttle NOCB kthread grace-period rate
Paul E. McKenney [Fri, 9 May 2014 21:30:53 +0000 (14:30 -0700)]
rcu: Throttle NOCB kthread grace-period rate

On a system with high CPU utilization and high context-switch rates,
grace periods tend to complete quite quickly.  If all CPUs are no-CBs
CPUs, and all are producing at least one callback per grace period, all
the rcuo kthreads will need to be awakened on every grace period, which
on large systems can be an excessive number of wakeups.  This commit
therefore throttles the rcuo kthreads to prevent them from needing
a grace-period wakeup more often than the interval between a pair of
force-quiescent-state scans.

Reported-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agotorture: Avoid format string leak to thead name
Kees Cook [Thu, 22 May 2014 18:51:04 +0000 (11:51 -0700)]
torture: Avoid format string leak to thead name

Since the torture-test thread creation interface does not include
format string arguments, this commit makes sure the name can never be
accidentally processed as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
9 years agodocumentation: Clarify wake-up/memory-barrier relationship
Paul E. McKenney [Tue, 13 May 2014 17:14:51 +0000 (10:14 -0700)]
documentation: Clarify wake-up/memory-barrier relationship

This commit adds an example demonstrating that if a wake_up() doesn't
actually wake something up, no memory ordering is provided.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: remove redundant ACCESS_ONCE() from tick_do_timer_cpu
Paul E. McKenney [Sat, 10 May 2014 01:06:51 +0000 (18:06 -0700)]
rcu: remove redundant ACCESS_ONCE() from tick_do_timer_cpu

In kernels built with CONFIG_NO_HZ_FULL, tick_do_timer_cpu is constant
once boot completes.  Thus, there is no need to wrap it in ACCESS_ONCE()
in code that is built only when CONFIG_NO_HZ_FULL.  This commit therefore
removes the redundant ACCESS_ONCE().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Make rcu node arrays static const char * const
Fabian Frederick [Tue, 6 May 2014 17:21:14 +0000 (19:21 +0200)]
rcu: Make rcu node arrays static const char * const

Those two arrays are being passed to lockdep_init_map(), which expects
const char *, and are stored in lockdep_map the same way.

Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agosignal: Explain local_irq_save() call
Paul E. McKenney [Mon, 5 May 2014 15:18:30 +0000 (08:18 -0700)]
signal: Explain local_irq_save() call

The explicit local_irq_save() in __lock_task_sighand() is needed to avoid
a potential deadlock condition, as noted in a841796f11c90d53 (signal:
align __lock_task_sighand() irq disabling and RCU).  However, someone
reading the code might be forgiven for concluding that this separate
local_irq_save() was completely unnecessary.  This commit therefore adds
a comment referencing the shiny new block comment on rcu_read_unlock().

Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
9 years agorcu: Handle obsolete references to TINY_PREEMPT_RCU
Paul E. McKenney [Sun, 4 May 2014 22:41:21 +0000 (15:41 -0700)]
rcu: Handle obsolete references to TINY_PREEMPT_RCU

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agorcu: Document deadlock-avoidance information for rcu_read_unlock()
Paul E. McKenney [Sun, 4 May 2014 22:38:38 +0000 (15:38 -0700)]
rcu: Document deadlock-avoidance information for rcu_read_unlock()

Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agotorture: Clean up diagnostics from --buildonly runs
Paul E. McKenney [Tue, 29 Apr 2014 16:53:34 +0000 (09:53 -0700)]
torture: Clean up diagnostics from --buildonly runs

Currently the post-processing complains about the lack of rcutorture
output when --buildonly is set and also emits misleading messages about
kernels being started and finishing.  This commit suppresses these
complaints and messages.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agotorture: Enable versions without CFcommon to function correctly
Paul E. McKenney [Sat, 19 Apr 2014 18:00:04 +0000 (11:00 -0700)]
torture: Enable versions without CFcommon to function correctly

The CFcommon file must now be present, which makes using the current
scripts against old kernel versions cumbersome.  This commit therefore
makes the CFcommon file be optional, so that old kernel versions can be
used with current torture scripts.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agoGFS2: Allow caching of glocks for flock
Bob Peterson [Thu, 26 Jun 2014 14:47:48 +0000 (10:47 -0400)]
GFS2: Allow caching of glocks for flock

This patch removes the GLF_NOCACHE flag from the glocks associated with
flocks. There should be no good reason not to cache glocks for flocks:
they only force the glock to be demoted before they can be reacquired,
which can slow down performance and even cause glock hangs, especially
in cases where the flocks are held in Shared (SH) mode.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
9 years agoGFS2: Allow flocks to use normal glock dq rather than dq_wait
Bob Peterson [Thu, 26 Jun 2014 14:46:25 +0000 (10:46 -0400)]
GFS2: Allow flocks to use normal glock dq rather than dq_wait

This patch allows flock glocks to use a non-blocking dequeue rather
than dq_wait. It also reverts the previous patch I had posted regarding
dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
this might avoid unforeseen side effects, and was therefore safer.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
9 years ago[regression] fix 32-bit breakage in block device read(2)
Al Viro [Thu, 26 Jun 2014 16:31:13 +0000 (12:31 -0400)]
[regression] fix 32-bit breakage in block device read(2)

blkdev_read_iter() wants to cap the iov_iter by the amount of
data remaining to the end of device.  That's what iov_iter_truncate()
is for (trim iter->count if it's above the given limit).  So far,
so good, but the argument of iov_iter_truncate() is size_t, so on
32bit boxen (in case of a large device) we end up with that upper
limit truncated down to 32 bits *before* comparing it with iter->count.

Easily fixed by making iov_iter_truncate() take 64bit argument -
it does the right thing after such change (we only reach the
assignment in there when the current value of iter->count is greater
than the limit, i.e. for anything that would get truncated we don't
reach the assignment at all) and that argument is not the new
value of iter->count - it's an upper limit for such.

The overhead of passing u64 is not an issue - the thing is inlined,
so callers passing size_t won't pay any penalty.

Reported-by: Theodore Tso <tytso@mit.edu>
Tested-by: Theodore Tso <tytso@mit.edu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agoext4: Fix hole punching for files with indirect blocks
Jan Kara [Thu, 26 Jun 2014 16:30:54 +0000 (12:30 -0400)]
ext4: Fix hole punching for files with indirect blocks

Hole punching code for files with indirect blocks wrongly computed
number of blocks which need to be cleared when traversing the indirect
block tree. That could result in punching more blocks than actually
requested and thus effectively cause a data loss. For example:

fallocate -n -p 10240000 4096

will punch the range 10240000 - 12632064 instead of the range 1024000 -
10244096. Fix the calculation.

CC: stable@vger.kernel.org
Fixes: 8bad6fc813a3a5300f51369c39d315679fd88c72
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>