summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Powalowski <tobias@T-POWA-LX.(none)>2011-01-24 18:22:44 +0100
committerTobias Powalowski <tobias@T-POWA-LX.(none)>2011-01-24 18:22:44 +0100
commitcdfbe45b0a8cef060775030bcfe94fbc5a58804d (patch)
tree3d4fe09143e699ac30731aa938bcc2ab35ab16f8
parent9a1092bdf89d805634de2660fadff7a2ca6c6830 (diff)
fix udev issue, bump to latest aufs2.1 branch
-rw-r--r--PATCHCFG9
-rw-r--r--patches/aufs2-base-20110124.patch (renamed from patches/aufs2-base-20110105.patch)4
-rw-r--r--patches/aufs2-standalone-20110124.patch (renamed from patches/aufs2-standalone-20110105.patch)4
-rw-r--r--patches/libata-alignment-2.6.37.patch71
4 files changed, 81 insertions, 7 deletions
diff --git a/PATCHCFG b/PATCHCFG
index c1b2ab8..c5e3f25 100644
--- a/PATCHCFG
+++ b/PATCHCFG
@@ -15,13 +15,16 @@ PATCHES=(
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
+ # fix #22343 udev crashes
+ libata-alignment-2.6.37.patch%1
+
# add aufs2 support, in reference to:
# http://aufs.sourceforge.net
- aufs2-base-20110105.patch%1
- aufs2-standalone-20110105.patch%1
+ aufs2-base-20110124.patch%1
+ aufs2-standalone-20110124.patch%1
)
# Name of the resulting patch (will be bzipped afterwards)
-PATCHNAME="patch-2.6.37-1-ARCH"
+PATCHNAME="patch-2.6.37-2-ARCH"
# Run this before applying patches
pre_apply() {
diff --git a/patches/aufs2-base-20110105.patch b/patches/aufs2-base-20110124.patch
index 02c243d..5beda6d 100644
--- a/patches/aufs2-base-20110105.patch
+++ b/patches/aufs2-base-20110124.patch
@@ -1,7 +1,7 @@
-aufs2.1 base patch for linux-2.6.
+aufs2.1 base patch for linux-2.6.37
diff --git a/fs/namei.c b/fs/namei.c
-index 5362af9..5fe904d 100644
+index 4ff7ca5..a8c583f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1161,12 +1161,12 @@ out:
diff --git a/patches/aufs2-standalone-20110105.patch b/patches/aufs2-standalone-20110124.patch
index d10df2b..fa2b70e 100644
--- a/patches/aufs2-standalone-20110105.patch
+++ b/patches/aufs2-standalone-20110124.patch
@@ -1,4 +1,4 @@
-aufs2.1 standalone patch for linux-2.6.
+aufs2.1 standalone patch for linux-2.6.37
diff --git a/fs/file_table.c b/fs/file_table.c
index c3dee38..f529e4d 100644
@@ -26,7 +26,7 @@ index ae2727a..2c8071a 100644
/*
* iprune_sem provides exclusion between the kswapd or try_to_free_pages
diff --git a/fs/namei.c b/fs/namei.c
-index 5fe904d..8af12f7 100644
+index a8c583f..b020c45 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -347,6 +347,7 @@ int deny_write_access(struct file * file)
diff --git a/patches/libata-alignment-2.6.37.patch b/patches/libata-alignment-2.6.37.patch
new file mode 100644
index 0000000..1c26528
--- /dev/null
+++ b/patches/libata-alignment-2.6.37.patch
@@ -0,0 +1,71 @@
+ata_pio_sectors() expects buffer for each sector to be contained in a
+single page; otherwise, it ends up overrunning the first page. This
+is achieved by setting queue DMA alignment. If sector_size is smaller
+than PAGE_SIZE and all buffers are sector_size aligned, buffer for
+each sector is always contained in a single page.
+
+This wasn't applied to ATAPI devices but IDENTIFY_PACKET is executed
+as ATA_PROT_PIO and thus uses ata_pio_sectors(). Newer versions of
+udev issue IDENTIFY_PACKET with unaligned buffer triggering the
+problem and causing oops.
+
+This patch fixes the problem by setting sdev->sector_size to
+ATA_SECT_SIZE on ATATPI devices and always setting DMA alignment to
+sector_size. While at it, add a warning for the unlikely but still
+possible scenario where sector_size is larger than PAGE_SIZE, in which
+case the alignment wouldn't be enough.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Reported-by: John Stanley <jpsinthemix@verizon.net>
+Tested-by: John Stanley <jpsinthemix@verizon.net>
+Cc: stable@kernel.org
+---
+ drivers/ata/libata-scsi.c | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
+index 5defc74..600f635 100644
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -1099,9 +1099,9 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
+ struct request_queue *q = sdev->request_queue;
+ void *buf;
+
+- /* set the min alignment and padding */
+- blk_queue_update_dma_alignment(sdev->request_queue,
+- ATA_DMA_PAD_SZ - 1);
++ sdev->sector_size = ATA_SECT_SIZE;
++
++ /* set DMA padding */
+ blk_queue_update_dma_pad(sdev->request_queue,
+ ATA_DMA_PAD_SZ - 1);
+
+@@ -1115,13 +1115,25 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
+
+ blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
+ } else {
+- /* ATA devices must be sector aligned */
+ sdev->sector_size = ata_id_logical_sector_size(dev->id);
+- blk_queue_update_dma_alignment(sdev->request_queue,
+- sdev->sector_size - 1);
+ sdev->manage_start_stop = 1;
+ }
+
++ /*
++ * ata_pio_sectors() expects buffer for each sector to not cross
++ * page boundary. Enforce it by requiring buffers to be sector
++ * aligned, which works iff sector_size is not larger than
++ * PAGE_SIZE. ATAPI devices also need the alignment as
++ * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
++ */
++ if (sdev->sector_size > PAGE_SIZE)
++ ata_dev_printk(dev, KERN_WARNING,
++ "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
++ sdev->sector_size);
++
++ blk_queue_update_dma_alignment(sdev->request_queue,
++ sdev->sector_size - 1);
++
+ if (dev->flags & ATA_DFLAG_AN)
+ set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
+