]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2013 19:36:45 +0000 (12:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2013 19:36:45 +0000 (12:36 -0700)
added patches:
btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch
drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch
s390-mm-fix-flush_tlb_kernel_range.patch

queue-3.0/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch [new file with mode: 0644]
queue-3.0/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch [new file with mode: 0644]
queue-3.0/s390-mm-fix-flush_tlb_kernel_range.patch [new file with mode: 0644]
queue-3.0/series

diff --git a/queue-3.0/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch b/queue-3.0/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch
new file mode 100644 (file)
index 0000000..3ebf29c
--- /dev/null
@@ -0,0 +1,58 @@
+From bc178622d40d87e75abc131007342429c9b03351 Mon Sep 17 00:00:00 2001
+From: Eric Sandeen <sandeen@redhat.com>
+Date: Sat, 9 Mar 2013 15:18:39 +0000
+Subject: btrfs: use rcu_barrier() to wait for bdev puts at unmount
+
+From: Eric Sandeen <sandeen@redhat.com>
+
+commit bc178622d40d87e75abc131007342429c9b03351 upstream.
+
+Doing this would reliably fail with -EBUSY for me:
+
+# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2
+...
+unable to open /dev/sdb2: Device or resource busy
+
+because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.
+
+Using systemtap to track bdev gets & puts shows a kworker thread doing a
+blkdev put after mkfs attempts a get; this is left over from the unmount
+path:
+
+btrfs_close_devices
+       __btrfs_close_devices
+               call_rcu(&device->rcu, free_device);
+                       free_device
+                               INIT_WORK(&device->rcu_work, __free_device);
+                               schedule_work(&device->rcu_work);
+
+so unmount might complete before __free_device fires & does its blkdev_put.
+
+Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait
+until all blkdev_put()s are done, and the device is truly free once
+unmount completes.
+
+Signed-off-by: Eric Sandeen <sandeen@redhat.com>
+Signed-off-by: Josef Bacik <jbacik@fusionio.com>
+Signed-off-by: Chris Mason <chris.mason@fusionio.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/volumes.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/fs/btrfs/volumes.c
++++ b/fs/btrfs/volumes.c
+@@ -546,6 +546,12 @@ int btrfs_close_devices(struct btrfs_fs_
+               __btrfs_close_devices(fs_devices);
+               free_fs_devices(fs_devices);
+       }
++      /*
++       * Wait for rcu kworkers under __btrfs_close_devices
++       * to finish all blkdev_puts so device is really
++       * free when umount is done.
++       */
++      rcu_barrier();
+       return ret;
+ }
diff --git a/queue-3.0/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch b/queue-3.0/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch
new file mode 100644 (file)
index 0000000..f3b340e
--- /dev/null
@@ -0,0 +1,39 @@
+From e79e0fe380847493266fba557217e2773c61bd1b Mon Sep 17 00:00:00 2001
+From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+Date: Wed, 3 Oct 2012 17:15:26 +0300
+Subject: drm/i915: EBUSY status handling added to i915_gem_fault().
+
+From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+
+commit e79e0fe380847493266fba557217e2773c61bd1b upstream.
+
+Subsequent threads returning EBUSY from vm_insert_pfn() was not handled
+correctly. As a result concurrent access from new threads to
+mmapped data caused SIGBUS.
+
+Note that this fixes i-g-t/tests/gem_threaded_tiled_access.
+
+Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
+Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_gem.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -1256,6 +1256,11 @@ out:
+       case 0:
+       case -ERESTARTSYS:
+       case -EINTR:
++      case -EBUSY:
++              /*
++               * EBUSY is ok: this just means that another thread
++               * already did the job.
++               */
+               return VM_FAULT_NOPAGE;
+       case -ENOMEM:
+               return VM_FAULT_OOM;
diff --git a/queue-3.0/s390-mm-fix-flush_tlb_kernel_range.patch b/queue-3.0/s390-mm-fix-flush_tlb_kernel_range.patch
new file mode 100644 (file)
index 0000000..8a0ad21
--- /dev/null
@@ -0,0 +1,44 @@
+From f6a70a07079518280022286a1dceb797d12e1edf Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Mon, 4 Mar 2013 14:14:11 +0100
+Subject: s390/mm: fix flush_tlb_kernel_range()
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit f6a70a07079518280022286a1dceb797d12e1edf upstream.
+
+Our flush_tlb_kernel_range() implementation calls __tlb_flush_mm() with
+&init_mm as argument. __tlb_flush_mm() however will only flush tlbs
+for the passed in mm if its mm_cpumask is not empty.
+
+For the init_mm however its mm_cpumask has never any bits set. Which in
+turn means that our flush_tlb_kernel_range() implementation doesn't
+work at all.
+
+This can be easily verified with a vmalloc/vfree loop which allocates
+a page, writes to it and then frees the page again. A crash will follow
+almost instantly.
+
+To fix this remove the cpumask_empty() check in __tlb_flush_mm() since
+there shouldn't be too many mms with a zero mm_cpumask, besides the
+init_mm of course.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/include/asm/tlbflush.h |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/arch/s390/include/asm/tlbflush.h
++++ b/arch/s390/include/asm/tlbflush.h
+@@ -73,8 +73,6 @@ static inline void __tlb_flush_idte(unsi
+ static inline void __tlb_flush_mm(struct mm_struct * mm)
+ {
+-      if (unlikely(cpumask_empty(mm_cpumask(mm))))
+-              return;
+       /*
+        * If the machine has IDTE we prefer to do a per mm flush
+        * on all cpus instead of doing a local flush if the mm
index 3d10d687c805164dd1f40429024f30b02a533dcc..1aac87db7654e0312be2133f03ddc79a0334d668 100644 (file)
@@ -22,3 +22,6 @@ selinux-use-gfp_atomic-under-spin_lock.patch
 perf-x86-fix-kernel-crash-with-pebs-bts-after-suspend-resume.patch
 perf-x86-fix-wrmsr_on_cpu-warning-on-suspend-resume.patch
 perf-x86-fix-link-failure-for-non-intel-configs.patch
+s390-mm-fix-flush_tlb_kernel_range.patch
+btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch
+drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch