Re: [PATCH 04/20] target: Enforce 1 page max for control cdb buffer sizes

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

 



On Thu, Jul 07, 2011 at 03:33:15PM -0700, Andy Grover wrote:
> Due to all cdbs' data buffers being referenced by scatterlists, buffers
> of more than a page are not contiguous. Instead of handling this in all
> control command handlers, we may be able to get away with just limiting
> control cdb data buffers to one page. The only control CDBs we handle that
> have potentially large data buffers are REPORT LUNS and UNMAP, so if we
> didn't want to live with this limitation, they would need to be modified
> to walk the pages in the data buffer's sgl.
> 
> Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
> ---
>  drivers/target/target_core_transport.c |    5 +++++
>  include/target/target_core_base.h      |    1 +
>  2 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index e2887c3..f9645b7 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -3568,6 +3568,11 @@ static int transport_generic_cmd_sequencer(
>  		cmd->data_length = size;
>  	}
>  
> +	/* Let's limit control cdbs to a page, for simplicity's sake. */
> +	if ((cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB)
> +	    && size > PAGE_SIZE)
> +		goto out_invalid_cdb_field;

Normal Linux style would be the operand at the end of the previous line.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux