[stgt] [PATCH] Fix add_mode_page to accept pages with page data smaller than the page size

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Tue Aug 28 08:53:01 CEST 2012


On Sun, 26 Aug 2012 16:55:22 +0300
Roi Dayan <roid at mellanox.com> wrote:

> Rest of the page data will be zeroed because of how the page is allocated.
> 
> Signed-off-by: Roi Dayan <roid at mellanox.com>
> ---
>  usr/spc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

I fixed the comment too. The following patch was applied.

=
>From 1af0e414d4f7a61524936e34f29f0a2d64d508c3 Mon Sep 17 00:00:00 2001
From: Roi Dayan <roid at mellanox.com>
Date: Tue, 28 Aug 2012 15:49:02 +0900
Subject: [PATCH] spc: Fix add_mode_page to accept pages with page data smaller than the page size

Rest of the page data will be zeroed because of how the page is allocated.

Signed-off-by: Roi Dayan <roid at mellanox.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 usr/spc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 10d799e..1cbc2c1 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -1642,9 +1642,9 @@ tgtadm_err add_mode_page(struct scsi_lu *lu, char *p)
 			p++;
 	}
 
-	if (i != size + 3) {
+	if (i > size + 3) {
 		adm_err = TGTADM_INVALID_REQUEST;
-		eprintf("Mode Page %d (0x%02x): param_count %d != "
+		eprintf("Mode Page %d (0x%02x): param_count %d > "
 			"MODE PAGE size : %d\n", pcode, subpcode, i, size + 3);
 	}
 exit:
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list