[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56E66B93.1030506@suse.de>
Date: Mon, 14 Mar 2016 08:43:15 +0100
From: Hannes Reinecke <hare@...e.de>
To: Finn Thain <fthain@...egraphics.com.au>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Michael Schmitz <schmitzmic@...il.com>,
linux-m68k@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Ondrej Zary <linux@...nbow-software.org>,
Sam Creasey <sammy@...my.net>
Subject: Re: [PATCH 14/22] ncr5380: Add MAX_LUN limit
On 03/14/2016 05:27 AM, Finn Thain wrote:
> The driver has a limit of eight LUs because of the byte-sized bitfield
> that is used for busy flags. Reject commands with LUN > 7.
>
> Signed-off-by: Finn Thain <fthain@...egraphics.com.au>
>
> ---
> drivers/scsi/NCR5380.c | 6 ++++++
> drivers/scsi/NCR5380.h | 2 ++
> 2 files changed, 8 insertions(+)
>
> Index: linux/drivers/scsi/NCR5380.c
> ===================================================================
> --- linux.orig/drivers/scsi/NCR5380.c 2016-03-14 15:26:45.000000000 +1100
> +++ linux/drivers/scsi/NCR5380.c 2016-03-14 15:26:48.000000000 +1100
> @@ -661,6 +661,12 @@ static int NCR5380_queue_command(struct
> }
> #endif /* (NDEBUG & NDEBUG_NO_WRITE) */
>
> + if (cmd->device->lun > MAX_LUN) {
> + cmd->result = DID_NO_CONNECT << 16;
> + cmd->scsi_done(cmd);
> + return 0;
> + }
> +
> cmd->result = 0;
>
> if (!NCR5380_acquire_dma_irq(instance))
> Index: linux/drivers/scsi/NCR5380.h
> ===================================================================
> --- linux.orig/drivers/scsi/NCR5380.h 2016-03-14 15:26:45.000000000 +1100
> +++ linux/drivers/scsi/NCR5380.h 2016-03-14 15:26:48.000000000 +1100
> @@ -244,6 +244,8 @@ struct NCR5380_hostdata {
>
> #ifdef __KERNEL__
>
> +#define MAX_LUN 7
> +
> struct NCR5380_cmd {
> struct list_head list;
> };
>
>
Why not simply use shost->max_lun ?
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@...e.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Powered by blists - more mailing lists