[kernel] r22881 - in dists/jessie/linux/debian: . patches patches/bugfix/all

Ben Hutchings benh at moszumanska.debian.org
Sun Aug 2 02:20:54 UTC 2015


Author: benh
Date: Sun Aug  2 02:20:54 2015
New Revision: 22881

Log:
Add patches to fix two discard/trim bugs

Added:
   dists/jessie/linux/debian/patches/bugfix/all/block-do-a-full-clone-when-splitting-discard-bios.patch
   dists/jessie/linux/debian/patches/bugfix/all/libata-add-ata_horkage_notrim.patch
   dists/jessie/linux/debian/patches/bugfix/all/libata-force-disable-trim-for-supersspeed-s238.patch
Modified:
   dists/jessie/linux/debian/changelog
   dists/jessie/linux/debian/patches/series

Modified: dists/jessie/linux/debian/changelog
==============================================================================
--- dists/jessie/linux/debian/changelog	Sat Aug  1 17:30:02 2015	(r22880)
+++ dists/jessie/linux/debian/changelog	Sun Aug  2 02:20:54 2015	(r22881)
@@ -460,6 +460,9 @@
   * [mips*] Correct FP ISA requirements (Closes: #781892)
   * Revert "ACPICA: Utilities: split IO address types from data type models."
     to avoid ABI change on i386
+  * libata: add ATA_HORKAGE_NOTRIM
+  * libata: force disable trim for SuperSSpeed S238
+  * block: Do a full clone when splitting discard bios (Closes: #793326)
 
   [ Ian Campbell ]
   * [xen] xen-netback: return correct ethtool stats (Closes: #786936)

Added: dists/jessie/linux/debian/patches/bugfix/all/block-do-a-full-clone-when-splitting-discard-bios.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/jessie/linux/debian/patches/bugfix/all/block-do-a-full-clone-when-splitting-discard-bios.patch	Sun Aug  2 02:20:54 2015	(r22881)
@@ -0,0 +1,60 @@
+From: "Martin K. Petersen" <martin.petersen at oracle.com>
+Date: Wed, 22 Jul 2015 07:57:12 -0400
+Subject: block: Do a full clone when splitting discard bios
+Origin: https://git.kernel.org/linus/f3f5da624e0a891c34d8cd513c57f1d9b0c7dadc
+Bug-Debian: https://bugs.debian.org/793326
+
+This fixes a data corruption bug when using discard on top of MD linear,
+raid0 and raid10 personalities.
+
+Commit 20d0189b1012 "block: Introduce new bio_split()" permits sharing
+the bio_vec between the two resulting bios. That is fine for read/write
+requests where the bio_vec is immutable. For discards, however, we need
+to be able to attach a payload and update the bio_vec so the page can
+get mapped to a scatterlist entry. Therefore the bio_vec can not be
+shared when splitting discards and we must do a full clone.
+
+Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
+Reported-by: Seunguk Shin <seunguk.shin at samsung.com>
+Tested-by: Seunguk Shin <seunguk.shin at samsung.com>
+Cc: Seunguk Shin <seunguk.shin at samsung.com>
+Cc: Jens Axboe <axboe at fb.com>
+Cc: Kent Overstreet <kent.overstreet at gmail.com>
+Cc: <stable at vger.kernel.org> # v3.14+
+Reviewed-by: Christoph Hellwig <hch at lst.de>
+Signed-off-by: Jens Axboe <axboe at fb.com>
+---
+ block/bio.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/block/bio.c
++++ b/block/bio.c
+@@ -1820,8 +1820,9 @@ EXPORT_SYMBOL(bio_endio_nodec);
+  * Allocates and returns a new bio which represents @sectors from the start of
+  * @bio, and updates @bio to represent the remaining sectors.
+  *
+- * The newly allocated bio will point to @bio's bi_io_vec; it is the caller's
+- * responsibility to ensure that @bio is not freed before the split.
++ * Unless this is a discard request the newly allocated bio will point
++ * to @bio's bi_io_vec; it is the caller's responsibility to ensure that
++ * @bio is not freed before the split.
+  */
+ struct bio *bio_split(struct bio *bio, int sectors,
+ 		      gfp_t gfp, struct bio_set *bs)
+@@ -1831,7 +1832,15 @@ struct bio *bio_split(struct bio *bio, i
+ 	BUG_ON(sectors <= 0);
+ 	BUG_ON(sectors >= bio_sectors(bio));
+ 
+-	split = bio_clone_fast(bio, gfp, bs);
++	/*
++	 * Discards need a mutable bio_vec to accommodate the payload
++	 * required by the DSM TRIM and UNMAP commands.
++	 */
++	if (bio->bi_rw & REQ_DISCARD)
++		split = bio_clone_bioset(bio, gfp, bs);
++	else
++		split = bio_clone_fast(bio, gfp, bs);
++
+ 	if (!split)
+ 		return NULL;
+ 

Added: dists/jessie/linux/debian/patches/bugfix/all/libata-add-ata_horkage_notrim.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/jessie/linux/debian/patches/bugfix/all/libata-add-ata_horkage_notrim.patch	Sun Aug  2 02:20:54 2015	(r22881)
@@ -0,0 +1,45 @@
+From: Arne Fitzenreiter <arne_f at ipfire.org>
+Date: Wed, 15 Jul 2015 13:54:36 +0200
+Subject: libata: add ATA_HORKAGE_NOTRIM
+Origin: https://git.kernel.org/linus/71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0
+
+Some devices lose data on TRIM whether queued or not.  This patch adds
+a horkage to disable TRIM.
+
+tj: Collapsed unnecessary if() nesting.
+
+Signed-off-by: Arne Fitzenreiter <arne_f at ipfire.org>
+Signed-off-by: Tejun Heo <tj at kernel.org>
+Cc: stable at vger.kernel.org
+[bwh: Backported to 3.16:
+ - Adjust context
+ - Drop changes to show_ata_dev_trim()]
+---
+ drivers/ata/libata-scsi.c      | 3 ++-
+ drivers/ata/libata-transport.c | 2 ++
+ include/linux/libata.h         | 2 ++
+ 3 files changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -2514,7 +2514,8 @@ static unsigned int ata_scsiop_read_cap(
+ 		rbuf[14] = (lowest_aligned >> 8) & 0x3f;
+ 		rbuf[15] = lowest_aligned;
+ 
+-		if (ata_id_has_trim(args->id)) {
++		if (ata_id_has_trim(args->id) &&
++		    !(dev->horkage & ATA_HORKAGE_NOTRIM)) {
+ 			rbuf[14] |= 0x80; /* TPE */
+ 
+ 			if (ata_id_has_zero_after_trim(args->id))
+--- a/include/linux/libata.h
++++ b/include/linux/libata.h
+@@ -422,6 +422,8 @@ enum {
+ 	ATA_HORKAGE_NO_NCQ_TRIM	= (1 << 19),	/* don't use queued TRIM */
+ 	ATA_HORKAGE_NOLPM	= (1 << 20),	/* don't use LPM */
+ 	ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21),	/* some WDs have broken LPM */
++	ATA_HORKAGE_NOTRIM	= (1 << 24),	/* don't use TRIM */
++
+ 
+ 	 /* DMA mask for user DMA control: User visible values; DO NOT
+ 	    renumber */

Added: dists/jessie/linux/debian/patches/bugfix/all/libata-force-disable-trim-for-supersspeed-s238.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/jessie/linux/debian/patches/bugfix/all/libata-force-disable-trim-for-supersspeed-s238.patch	Sun Aug  2 02:20:54 2015	(r22881)
@@ -0,0 +1,28 @@
+From: Arne Fitzenreiter <arne_f at ipfire.org>
+Date: Wed, 15 Jul 2015 13:54:37 +0200
+Subject: libata: force disable trim for SuperSSpeed S238
+Origin: https://git.kernel.org/linus/cda57b1b05cf7b8b99ab4b732bea0b05b6c015cc
+
+This device loses blocks, often the partition table area, on trim.
+Disable TRIM.
+http://pcengines.ch/msata16a.htm
+
+Signed-off-by: Arne Fitzenreiter <arne_f at ipfire.org>
+Signed-off-by: Tejun Heo <tj at kernel.org>
+Cc: stable at vger.kernel.org
+---
+ drivers/ata/libata-core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4231,6 +4231,9 @@ static const struct ata_blacklist_entry
+ 	{ "Crucial_CT*MX100*",		"MU01", ATA_HORKAGE_NO_NCQ_TRIM, },
+ 	{ "Samsung SSD 8*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+ 
++	/* devices that don't properly handle TRIM commands */
++	{ "SuperSSpeed S238*",		NULL,	ATA_HORKAGE_NOTRIM, },
++
+ 	/*
+ 	 * Some WD SATA-I drives spin up and down erratically when the link
+ 	 * is put into the slumber mode.  We don't have full list of the

Modified: dists/jessie/linux/debian/patches/series
==============================================================================
--- dists/jessie/linux/debian/patches/series	Sat Aug  1 17:30:02 2015	(r22880)
+++ dists/jessie/linux/debian/patches/series	Sun Aug  2 02:20:54 2015	(r22881)
@@ -631,3 +631,6 @@
 debian/revert-libata-ignore-spurious-phy-event-on-lpm-polic.patch
 debian/udp-fix-abi-change-in-3.16.7-ckt14.patch
 debian/revert-acpica-utilities-split-io-address-types-from-.patch
+bugfix/all/libata-add-ata_horkage_notrim.patch
+bugfix/all/libata-force-disable-trim-for-supersspeed-s238.patch
+bugfix/all/block-do-a-full-clone-when-splitting-discard-bios.patch



More information about the Kernel-svn-changes mailing list