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

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

 



On Sun, 26 Aug 2012 16:55:22 +0300
Roi Dayan <roid@xxxxxxxxxxxx> wrote:

> Rest of the page data will be zeroed because of how the page is allocated.
> 
> Signed-off-by: Roi Dayan <roid@xxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxx>
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@xxxxxxxxxxxx>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux