summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-06-14 16:25:40 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-14 16:25:40 -0700
commit7f895058d02a6f0ae3d233805ef69b4d2dc86cb6 (patch)
treecbf056a7ea149a6dfe38c3d53cad3daaf0ef2181
parentb3ce5b1f27c2f8bfd40c063156ec2c0e3268e12b (diff)
downloadlongterm-queue-2.6.32-7f895058d02a6f0ae3d233805ef69b4d2dc86cb6.tar.gz
.32 patches
-rw-r--r--queue-2.6.32/cpufreq-remove-cpufreq_stats-sysfs-entries-on-module-unload.patch30
-rw-r--r--queue-2.6.32/md-check-hot_remove_disk-when-removing-disk.patch74
-rw-r--r--queue-2.6.32/md-raid5-fix-fua-request-handling-in-ops_run_io.patch55
-rw-r--r--queue-2.6.32/md-raid5-fix-raid5_set_bi_hw_segments.patch36
-rw-r--r--queue-2.6.32/series4
5 files changed, 199 insertions, 0 deletions
diff --git a/queue-2.6.32/cpufreq-remove-cpufreq_stats-sysfs-entries-on-module-unload.patch b/queue-2.6.32/cpufreq-remove-cpufreq_stats-sysfs-entries-on-module-unload.patch
new file mode 100644
index 0000000..64f542b
--- /dev/null
+++ b/queue-2.6.32/cpufreq-remove-cpufreq_stats-sysfs-entries-on-module-unload.patch
@@ -0,0 +1,30 @@
+From 13f067537f34456443f61c950cd6dc37d1d5f3ee Mon Sep 17 00:00:00 2001
+From: Dave Jones <davej@redhat.com>
+Date: Sun, 12 Jun 2011 16:35:28 -0400
+Subject: CPUFREQ: Remove cpufreq_stats sysfs entries on module unload.
+
+From: Dave Jones <davej@redhat.com>
+
+commit 13f067537f34456443f61c950cd6dc37d1d5f3ee upstream.
+
+cpufreq_stats leaves behind its sysfs entries, which causes a panic
+when something stumbled across them.
+(Discovered by unloading cpufreq_stats while powertop was loaded).
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/cpufreq/cpufreq_stats.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/cpufreq/cpufreq_stats.c
++++ b/drivers/cpufreq/cpufreq_stats.c
+@@ -387,6 +387,7 @@ static void __exit cpufreq_stats_exit(vo
+ unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
+ for_each_online_cpu(cpu) {
+ cpufreq_stats_free_table(cpu);
++ cpufreq_stats_free_sysfs(cpu);
+ }
+ }
+
diff --git a/queue-2.6.32/md-check-hot_remove_disk-when-removing-disk.patch b/queue-2.6.32/md-check-hot_remove_disk-when-removing-disk.patch
new file mode 100644
index 0000000..1fd2b56
--- /dev/null
+++ b/queue-2.6.32/md-check-hot_remove_disk-when-removing-disk.patch
@@ -0,0 +1,74 @@
+From 01393f3d5836b7d62e925e6f4658a7eb22b83a11 Mon Sep 17 00:00:00 2001
+From: Namhyung Kim <namhyung@gmail.com>
+Date: Thu, 9 Jun 2011 11:42:54 +1000
+Subject: md: check ->hot_remove_disk when removing disk
+
+From: Namhyung Kim <namhyung@gmail.com>
+
+commit 01393f3d5836b7d62e925e6f4658a7eb22b83a11 upstream.
+
+Check pers->hot_remove_disk instead of pers->hot_add_disk in slot_store()
+during disk removal. The linear personality only has ->hot_add_disk and
+no ->hot_remove_disk, so that removing disk in the array resulted to
+following kernel bug:
+
+$ sudo mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/loop[0-3]
+$ echo none | sudo tee /sys/block/md0/md/dev-loop2/slot
+ BUG: unable to handle kernel NULL pointer dereference at (null)
+ IP: [< (null)>] (null)
+ PGD c9f5d067 PUD 8575a067 PMD 0
+ Oops: 0010 [#1] SMP
+ CPU 2
+ Modules linked in: linear loop bridge stp llc kvm_intel kvm asus_atk0110 sr_mod cdrom sg
+
+ Pid: 10450, comm: tee Not tainted 3.0.0-rc1-leonard+ #173 System manufacturer System Product Name/P5G41TD-M PRO
+ RIP: 0010:[<0000000000000000>] [< (null)>] (null)
+ RSP: 0018:ffff880085757df0 EFLAGS: 00010282
+ RAX: ffffffffa00168e0 RBX: ffff8800d1431800 RCX: 000000000000006e
+ RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff88008543c000
+ RBP: ffff880085757e48 R08: 0000000000000002 R09: 000000000000000a
+ R10: 0000000000000000 R11: ffff88008543c2e0 R12: 00000000ffffffff
+ R13: ffff8800b4641000 R14: 0000000000000005 R15: 0000000000000000
+ FS: 00007fe8c9e05700(0000) GS:ffff88011fa00000(0000) knlGS:0000000000000000
+ CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+ CR2: 0000000000000000 CR3: 00000000b4502000 CR4: 00000000000406e0
+ DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+ DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+ Process tee (pid: 10450, threadinfo ffff880085756000, task ffff8800c9f08000)
+ Stack:
+ ffffffff8138496a ffff8800b4641000 ffff88008543c268 0000000000000000
+ ffff8800b4641000 ffff88008543c000 ffff8800d1431868 ffffffff81a78a90
+ ffff8800b4641000 ffff88008543c000 ffff8800d1431800 ffff880085757e98
+ Call Trace:
+ [<ffffffff8138496a>] ? slot_store+0xaa/0x265
+ [<ffffffff81384bae>] rdev_attr_store+0x89/0xa8
+ [<ffffffff8115a96a>] sysfs_write_file+0x108/0x144
+ [<ffffffff81106b87>] vfs_write+0xb1/0x10d
+ [<ffffffff8106e6c0>] ? trace_hardirqs_on_caller+0x111/0x135
+ [<ffffffff81106cac>] sys_write+0x4d/0x77
+ [<ffffffff814fe702>] system_call_fastpath+0x16/0x1b
+ Code: Bad RIP value.
+ RIP [< (null)>] (null)
+ RSP <ffff880085757df0>
+ CR2: 0000000000000000
+ ---[ end trace ba5fc64319a826fb ]---
+
+Signed-off-by: Namhyung Kim <namhyung@gmail.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/md/md.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
+@@ -2262,7 +2262,7 @@ slot_store(mdk_rdev_t *rdev, const char
+ if (rdev->raid_disk == -1)
+ return -EEXIST;
+ /* personality does all needed checks */
+- if (rdev->mddev->pers->hot_add_disk == NULL)
++ if (rdev->mddev->pers->hot_remove_disk == NULL)
+ return -EINVAL;
+ err = rdev->mddev->pers->
+ hot_remove_disk(rdev->mddev, rdev->raid_disk);
diff --git a/queue-2.6.32/md-raid5-fix-fua-request-handling-in-ops_run_io.patch b/queue-2.6.32/md-raid5-fix-fua-request-handling-in-ops_run_io.patch
new file mode 100644
index 0000000..902ef0e
--- /dev/null
+++ b/queue-2.6.32/md-raid5-fix-fua-request-handling-in-ops_run_io.patch
@@ -0,0 +1,55 @@
+From b062962edb086011e94ec4d9eb3f6a6d814f2a8f Mon Sep 17 00:00:00 2001
+From: Namhyung Kim <namhyung@gmail.com>
+Date: Tue, 14 Jun 2011 14:20:19 +1000
+Subject: md/raid5: fix FUA request handling in ops_run_io()
+
+From: Namhyung Kim <namhyung@gmail.com>
+
+commit b062962edb086011e94ec4d9eb3f6a6d814f2a8f upstream.
+
+Commit e9c7469bb4f5 ("md: implment REQ_FLUSH/FUA support")
+introduced R5_WantFUA flag and set rw to WRITE_FUA in that case.
+However remaining code still checks whether rw is exactly same
+as WRITE or not, so FUAed-write ends up with being treated as
+READ. Fix it.
+
+This bug has been present since 2.6.37 and the fix is suitable for any
+-stable kernel since then. It is not clear why this has not caused
+more problems.
+
+Cc: Tejun Heo <tj@kernel.org>
+Signed-off-by: Namhyung Kim <namhyung@gmail.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/md/raid5.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/md/raid5.c
++++ b/drivers/md/raid5.c
+@@ -446,7 +446,7 @@ static void ops_run_io(struct stripe_hea
+ bi = &sh->dev[i].req;
+
+ bi->bi_rw = rw;
+- if (rw == WRITE)
++ if (rw & WRITE)
+ bi->bi_end_io = raid5_end_write_request;
+ else
+ bi->bi_end_io = raid5_end_read_request;
+@@ -480,13 +480,13 @@ static void ops_run_io(struct stripe_hea
+ bi->bi_io_vec[0].bv_offset = 0;
+ bi->bi_size = STRIPE_SIZE;
+ bi->bi_next = NULL;
+- if (rw == WRITE &&
++ if ((rw & WRITE) &&
+ test_bit(R5_ReWrite, &sh->dev[i].flags))
+ atomic_add(STRIPE_SECTORS,
+ &rdev->corrected_errors);
+ generic_make_request(bi);
+ } else {
+- if (rw == WRITE)
++ if (rw & WRITE)
+ set_bit(STRIPE_DEGRADED, &sh->state);
+ pr_debug("skip op %ld on disc %d for sector %llu\n",
+ bi->bi_rw, i, (unsigned long long)sh->sector);
diff --git a/queue-2.6.32/md-raid5-fix-raid5_set_bi_hw_segments.patch b/queue-2.6.32/md-raid5-fix-raid5_set_bi_hw_segments.patch
new file mode 100644
index 0000000..65d99d5
--- /dev/null
+++ b/queue-2.6.32/md-raid5-fix-raid5_set_bi_hw_segments.patch
@@ -0,0 +1,36 @@
+From 9b2dc8b665932a8e681a7ab3237f60475e75e161 Mon Sep 17 00:00:00 2001
+From: Namhyung Kim <namhyung@gmail.com>
+Date: Mon, 13 Jun 2011 14:48:22 +0900
+Subject: md/raid5: fix raid5_set_bi_hw_segments
+
+From: Namhyung Kim <namhyung@gmail.com>
+
+commit 9b2dc8b665932a8e681a7ab3237f60475e75e161 upstream.
+
+The @bio->bi_phys_segments consists of active stripes count in the
+lower 16 bits and processed stripes count in the upper 16 bits. So
+logical-OR operator should be bitwise one.
+
+This bug has been present since 2.6.27 and the fix is suitable for any
+-stable kernel since then. Fortunately the bad code is only used on
+error paths and is relatively unlikely to be hit.
+
+Signed-off-by: Namhyung Kim <namhyung@gmail.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/md/raid5.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/md/raid5.c
++++ b/drivers/md/raid5.c
+@@ -127,7 +127,7 @@ static inline int raid5_dec_bi_hw_segmen
+
+ static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt)
+ {
+- bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 16);
++ bio->bi_phys_segments = raid5_bi_phys_segments(bio) | (cnt << 16);
+ }
+
+ /* Find first data disk in a raid6 stripe */
diff --git a/queue-2.6.32/series b/queue-2.6.32/series
index 137747b..7af8ca2 100644
--- a/queue-2.6.32/series
+++ b/queue-2.6.32/series
@@ -70,3 +70,7 @@ usb-serial-add-another-4n-galaxy.de-pid-to-ftdi_sio-driver.patch
usb-xhci-fix-interval-calculation-for-fs-isoc-endpoints.patch
alsa-hda-fix-quirk-for-dell-inspiron-910.patch
oprofile-dcookies-fix-possible-circular-locking-dependency.patch
+cpufreq-remove-cpufreq_stats-sysfs-entries-on-module-unload.patch
+md-check-hot_remove_disk-when-removing-disk.patch
+md-raid5-fix-raid5_set_bi_hw_segments.patch
+md-raid5-fix-fua-request-handling-in-ops_run_io.patch