[kernel] r15694 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series
Ben Hutchings
benh at alioth.debian.org
Mon May 17 01:30:54 UTC 2010
Author: benh
Date: Mon May 17 01:30:52 2010
New Revision: 15694
Log:
Update patches from Tejun Heo for HPA workaround
Added:
dists/sid/linux-2.6/debian/patches/bugfix/all/buffer-make-invalidate_bdev-drain-all-add-caches.patch
Modified:
dists/sid/linux-2.6/debian/changelog
dists/sid/linux-2.6/debian/patches/bugfix/all/block-restart-partition-scan-after-resizing.patch
dists/sid/linux-2.6/debian/patches/series/13
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Mon May 17 01:01:25 2010 (r15693)
+++ dists/sid/linux-2.6/debian/changelog Mon May 17 01:30:52 2010 (r15694)
@@ -34,9 +34,12 @@
(Closes: #580710; works-around: #581173)
* rtl8192su: Add IDs for several more devices (Closes: #580740)
* Add drm and sfc changes from stable 2.6.33.4
- * SCSI/libata: Disable HPA if it overlaps a partition (Closes: #572618)
- * partitions: Rescan partition tables after HPA is disabled
- * libata: Disable HPA if it is only enabled after suspend
+ * Improve workaround for HPAs (Host Protected Areas) overlapping
+ partitions, thanks to Tejun Heo:
+ - SCSI/libata: Disable HPA if it overlaps a partition (Closes: #572618)
+ - buffer: Make invalidate_bdev() drain all percpu LRU add caches
+ - block: Rescan partition tables after HPA is disabled
+ - libata: Disable HPA if it is only enabled after suspend
* V4L/DVB: budget: Select correct frontend drivers (Closes: #575223)
* 3c503: Fix IRQ probing (Closes: #566522)
* sis-agp: Remove SIS 760, handled by amd64-agp
Modified: dists/sid/linux-2.6/debian/patches/bugfix/all/block-restart-partition-scan-after-resizing.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/bugfix/all/block-restart-partition-scan-after-resizing.patch Mon May 17 01:01:25 2010 (r15693)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/block-restart-partition-scan-after-resizing.patch Mon May 17 01:30:52 2010 (r15694)
@@ -1,32 +1,35 @@
From: Tejun Heo <tj at kernel.org>
-To: jeff at garzik.org, linux-ide at vger.kernel.org, jens.axboe at oracle.com, linux-scsi at vger.kernel.org, James.Bottomley at suse.de, linux-kernel at vger.kernel.org
-Cc: ben at decadent.org.uk, Tejun Heo <tj at kernel.org>
-Date: Thu, 13 May 2010 17:56:43 +0200
-Subject: [PATCH 1/4] block: restart partition scan after resizing a device
+To: jeff at garzik.org, linux-ide at vger.kernel.org, jens.axboe at oracle.com, linux-scsi at vger.kernel.org, James.Bottomley at suse.de, linux-kernel at vger.kernel.org, ben at decadent.org.uk, davem at davemloft.net, bzolnier at gmail.com
+Cc: Tejun Heo <tj at kernel.org>
+Date: Sat, 15 May 2010 20:09:28 +0200
+Subject: [PATCH 2/8] block: restart partition scan after resizing a device
Device resize via ->set_capacity() can reveal new partitions (e.g. in
chained partition table formats such as dos extended parts). Restart
-partition scan from the beginning after resizing a device.
+partition scan from the beginning after resizing a device. This
+change also makes libata always revalidate the disk after resize which
+makes lower layer native capacity unlocking implementation simpler and
+more robust as resize can be handled in the usual path.
Signed-off-by: Tejun Heo <tj at kernel.org>
Reported-by: Ben Hutchings <ben at decadent.org.uk>
---
- fs/partitions/check.c | 7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
+ fs/partitions/check.c | 16 ++++++----------
+ 1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
-index e238ab2..f80a58d 100644
+index e238ab2..8f01df3 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
-@@ -550,7 +550,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
- res = invalidate_partition(disk, 0);
- if (res)
- return res;
+@@ -544,7 +544,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
+ struct hd_struct *part;
+ struct parsed_partitions *state;
+ int p, highest, res;
-
+rescan:
- disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY);
- while ((part = disk_part_iter_next(&piter)))
- delete_partition(disk, part->partno);
+ if (bdev->bd_part_count)
+ return -EBUSY;
+ res = invalidate_partition(disk, 0);
@@ -581,7 +581,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
/* add partitions */
for (p = 1; p < state->limit; p++) {
@@ -36,11 +39,28 @@
size = state->parts[p].size;
if (!size)
continue;
-@@ -612,7 +612,8 @@ try_scan:
- check_disk_size_change(disk, bdev);
- bdev->bd_invalidated = 0;
- }
+@@ -596,7 +596,6 @@ try_scan:
+
+ if (from + size > get_capacity(disk)) {
+ const struct block_device_operations *bdops = disk->fops;
+- unsigned long long capacity;
+
+ printk(KERN_WARNING
+ "%s: p%d size %llu exceeds device capacity, ",
+@@ -605,14 +604,11 @@ try_scan:
+ if (bdops->set_capacity &&
+ (disk->flags & GENHD_FL_NATIVE_CAPACITY) == 0) {
+ printk(KERN_CONT "enabling native capacity\n");
+- capacity = bdops->set_capacity(disk, ~0ULL);
++ bdops->set_capacity(disk, ~0ULL);
+ disk->flags |= GENHD_FL_NATIVE_CAPACITY;
+- if (capacity > get_capacity(disk)) {
+- set_capacity(disk, capacity);
+- check_disk_size_change(disk, bdev);
+- bdev->bd_invalidated = 0;
+- }
- goto try_scan;
++ /* free state and restart */
+ kfree(state);
+ goto rescan;
} else {
Added: dists/sid/linux-2.6/debian/patches/bugfix/all/buffer-make-invalidate_bdev-drain-all-add-caches.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/buffer-make-invalidate_bdev-drain-all-add-caches.patch Mon May 17 01:30:52 2010 (r15694)
@@ -0,0 +1,38 @@
+From: Tejun Heo <tj at kernel.org>
+To: jeff at garzik.org, linux-ide at vger.kernel.org, jens.axboe at oracle.com, linux-scsi at vger.kernel.org, James.Bottomley at suse.de, linux-kernel at vger.kernel.org, ben at decadent.org.uk, davem at davemloft.net, bzolnier at gmail.com
+Cc: Tejun Heo <tj at kernel.org>
+Date: Sat, 15 May 2010 20:09:27 +0200
+Subject: [PATCH 1/8] buffer: make invalidate_bdev() drain all percpu LRU
+ add caches
+
+invalidate_bdev() should release all page cache pages which are clean
+and not being used; however, if some pages are still in the percpu LRU
+add caches on other cpus, those pages are considered in used and don't
+get released. Fix it by calling lru_add_drain_all() before trying to
+invalidate pages.
+
+This problem was discovered while testing block automatic native
+capacity unlocking. Null pages which were read before automatic
+unlocking didn't get released by invalidate_bdev() and ended up
+interfering with partition scan after unlocking.
+
+Signed-off-by: Tejun Heo <tj at kernel.org>
+---
+ fs/buffer.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/fs/buffer.c b/fs/buffer.c
+index c9c266d..08e422d 100644
+--- a/fs/buffer.c
++++ b/fs/buffer.c
+@@ -275,6 +275,7 @@ void invalidate_bdev(struct block_device *bdev)
+ return;
+
+ invalidate_bh_lrus();
++ lru_add_drain_all(); /* make sure all lru add caches are flushed */
+ invalidate_mapping_pages(mapping, 0, -1);
+ }
+ EXPORT_SYMBOL(invalidate_bdev);
+--
+1.6.4.2
+
Modified: dists/sid/linux-2.6/debian/patches/series/13
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/13 Mon May 17 01:01:25 2010 (r15693)
+++ dists/sid/linux-2.6/debian/patches/series/13 Mon May 17 01:30:52 2010 (r15694)
@@ -23,6 +23,7 @@
+ bugfix/all/stable/2.6.33.4.patch
+ bugfix/all/drm-i915-Stop-trying-to-use-ACPI-lid-status-to-deter-2.patch
+ features/arm/guruplug.patch
++ bugfix/all/buffer-make-invalidate_bdev-drain-all-add-caches.patch
+ bugfix/all/block-restart-partition-scan-after-resizing.patch
- debian/sd-libata-set-capacity-abi-changes.patch
+ bugfix/all/SCSI-implement-sd_set_capacity.patch
More information about the Kernel-svn-changes
mailing list