Re: [PATCH] sg: limit maximum cdb size to 252 bytes
Looks good, Reviewed-by: Christoph Hellwig h...@lst.de -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] sg: limit maximum cdb size to 252 bytes
On Wed, 2014-06-25 at 13:05 -0400, Douglas Gilbert wrote: Boaz Harrosh commented on the [PATCH v5] sg: relax 16 byte cdb restriction thread that SCSI variable length commands (which are all SCSI commands greater than 16 bytes long) must themselves be a multiple of 4 bytes long. ChangeLog - limit the maximum cdb size permitted by the sg v3 interface to 252 bytes. Commands that large are called variable length and their length needs to be a multiple of 4. Original patch: Reviewed-by: Boaz Harrosh b...@electrozaur.com Signed-off-by: Douglas Gilbert dgilb...@interlog.com Sure. Reviewed-by: Ewan D. Milne emi...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] sg: limit maximum cdb size to 252 bytes
Boaz Harrosh commented on the [PATCH v5] sg: relax 16 byte cdb restriction thread that SCSI variable length commands (which are all SCSI commands greater than 16 bytes long) must themselves be a multiple of 4 bytes long. ChangeLog - limit the maximum cdb size permitted by the sg v3 interface to 252 bytes. Commands that large are called variable length and their length needs to be a multiple of 4. Original patch: Reviewed-by: Boaz Harrosh b...@electrozaur.com Signed-off-by: Douglas Gilbert dgilb...@interlog.com diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index b6d183a..2e01a9d 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -74,9 +74,10 @@ static void sg_proc_cleanup(void); #define SG_MAX_DEVS 32768 /* SG_MAX_CDB_SIZE should be 260 (spc4r37 section 3.1.30) however the type - * of sg_io_hdr::cmd_len can only represent 255 + * of sg_io_hdr::cmd_len can only represent 255. All SCSI commands greater + * than 16 bytes are variable length whose length is a multiple of 4 */ -#define SG_MAX_CDB_SIZE 255 +#define SG_MAX_CDB_SIZE 252 /* * Suppose you want to calculate the formula muldiv(x,m,d)=int(x * m / d)
Re: [PATCH] sg: limit maximum cdb size to 252 bytes
Doug == Douglas Gilbert dgilb...@interlog.com writes: Doug Boaz Harrosh commented on the [PATCH v5] sg: relax 16 byte cdb Doug restriction thread that SCSI variable length commands (which are Doug all SCSI commands greater than 16 bytes long) must themselves be a Doug multiple of 4 bytes long. Doug ChangeLog Doug - limit the maximum cdb size permitted by the sg Doug v3 interface to 252 bytes. Commands that large are called Doug variable length and their length needs to be a multiple of Doug 4. Doug Original patch: Doug Reviewed-by: Boaz Harrosh b...@electrozaur.com Doug Signed-off-by: Douglas Gilbert dgilb...@interlog.com Reviewed-by: Martin K. Petersen martin.peter...@oracle.com -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html