[ 3.8.y.z extended stable ] Patch "[SCSI] sd: Fix parsing of 'temporary ' cache mode prefix" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Tue Jul 9 16:28:46 UTC 2013


This is a note to let you know that I have just added a patch titled

    [SCSI] sd: Fix parsing of 'temporary ' cache mode prefix

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 197f396ad5532223f777f829d35007fd191d3cf0 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben at decadent.org.uk>
Date: Mon, 27 May 2013 19:07:19 +0100
Subject: [PATCH] [SCSI] sd: Fix parsing of 'temporary ' cache mode prefix

commit 2ee3e26c673e75c05ef8b914f54fadee3d7b9c88 upstream.

Commit 39c60a0948cc '[SCSI] sd: fix array cache flushing bug causing
performance problems' added temp as a pointer to "temporary " and used
sizeof(temp) - 1 as its length.  But sizeof(temp) is the size of the
pointer, not the size of the string constant.  Change temp to a static
array so that sizeof() does what was intended.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
Signed-off-by: James Bottomley <JBottomley at Parallels.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 82910cc..0f0370f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr,
 	char *buffer_data;
 	struct scsi_mode_data data;
 	struct scsi_sense_hdr sshdr;
-	const char *temp = "temporary ";
+	static const char temp[] = "temporary ";
 	int len;

 	if (sdp->type != TYPE_DISK)
--
1.8.1.2





More information about the kernel-team mailing list