Re: [PATCH-for-stable 0/5] target: Recently merged fixes for stable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2013-09-04 at 04:42 +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> 
> Hi Greg,
> 
> This set of target fixes was just merged into mainline below, and would
> have been merged before v3.11 was released but unfortuately my PULL
> request(s) ended up in Linus's spam folder.  :-(
> 
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dcaaaeac871ff73043c616db3b2f91482637801d
> 
> Two of the patches where not marked as stable in target-pending.git, so
> I'm sending the entire series out preemptively now to let you know that:
> 
>    1) They all should be marked for stable, and
>    2) should be included immediately, given the already extended delay.
> 
> Patch #1 is marked for v3.0+. (it will likely fail to apply at a certain
> point, but I'll fix that up later)
[...]

I've queued up this version for 3.2:

From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Date: Wed, 24 Jul 2013 16:15:08 -0700
Subject: target: Fix trailing ASCII space usage in  INQUIRY vendor+model

commit ee60bddba5a5f23e39598195d944aa0eb2d455e5 upstream.

This patch fixes spc_emulate_inquiry_std() to add trailing ASCII
spaces for INQUIRY vendor + model fields following SPC-4 text:

  "ASCII data fields described as being left-aligned shall have any
   unused bytes at the end of the field (i.e., highest offset) and
   the unused bytes shall be filled with ASCII space characters (20h)."

This addresses a problem with Falconstor NSS multipathing.

Reported-by: Tomas Molota <tomas.molota@xxxxxxxxxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
[bwh: Backported to 3.2, based on Nicholas's versions for 3.0 and 3.4]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
 drivers/target/target_core_cdb.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

--- a/drivers/target/target_core_cdb.c
+++ b/drivers/target/target_core_cdb.c
@@ -127,11 +127,12 @@ target_emulate_inquiry_std(struct se_cmd
 		goto out;
 	}
 
-	snprintf((unsigned char *)&buf[8], 8, "LIO-ORG");
-	snprintf((unsigned char *)&buf[16], 16, "%s",
-		 &dev->se_sub_dev->t10_wwn.model[0]);
-	snprintf((unsigned char *)&buf[32], 4, "%s",
-		 &dev->se_sub_dev->t10_wwn.revision[0]);
+	memcpy(&buf[8], "LIO-ORG ", 8);
+	memset(&buf[16], 0x20, 16);
+	memcpy(&buf[16], dev->se_sub_dev->t10_wwn.model,
+	       min_t(size_t, strlen(dev->se_sub_dev->t10_wwn.model), 16));
+	memcpy(&buf[32], dev->se_sub_dev->t10_wwn.revision,
+	       min_t(size_t, strlen(dev->se_sub_dev->t10_wwn.revision), 4));
 	buf[4] = 31; /* Set additional length to 31 */
 
 out:

-- 
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]