From: Greg Kroah-Hartman Date: Mon, 18 Mar 2013 19:36:45 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.70~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f45e21fb2f077b30cdd6584b8316148e986ced5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches 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 --- 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 index 00000000000..3ebf29c148d --- /dev/null +++ b/queue-3.0/btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch @@ -0,0 +1,58 @@ +From bc178622d40d87e75abc131007342429c9b03351 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Sat, 9 Mar 2013 15:18:39 +0000 +Subject: btrfs: use rcu_barrier() to wait for bdev puts at unmount + +From: Eric Sandeen + +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 +Signed-off-by: Josef Bacik +Signed-off-by: Chris Mason +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..f3b340eb9cb --- /dev/null +++ b/queue-3.0/drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch @@ -0,0 +1,39 @@ +From e79e0fe380847493266fba557217e2773c61bd1b Mon Sep 17 00:00:00 2001 +From: Dmitry Rogozhkin +Date: Wed, 3 Oct 2012 17:15:26 +0300 +Subject: drm/i915: EBUSY status handling added to i915_gem_fault(). + +From: Dmitry Rogozhkin + +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 +Signed-off-by: Dmitry Rogozhkin +Reviewed-by: Chris Wilson +Signed-off-by: Daniel Vetter +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..8a0ad21ea87 --- /dev/null +++ b/queue-3.0/s390-mm-fix-flush_tlb_kernel_range.patch @@ -0,0 +1,44 @@ +From f6a70a07079518280022286a1dceb797d12e1edf Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Mon, 4 Mar 2013 14:14:11 +0100 +Subject: s390/mm: fix flush_tlb_kernel_range() + +From: Heiko Carstens + +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 +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-3.0/series b/queue-3.0/series index 3d10d687c80..1aac87db765 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -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