diff mbox series

[2/3] scsi: sg: increase number of devices

Message ID 20230602163845.32108-3-mwilck@suse.com (mailing list archive)
State New, archived
Headers show
Series scsi: fixes for targets with many LUNs | expand

Commit Message

Martin Wilck June 2, 2023, 4:38 p.m. UTC
From: Hannes Reinecke <hare@suse.de>

Larger setups may need to allocate more than 32k sg devices, so
increase the number of devices to the full range of minor device
numbers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Douglas Gilbert June 4, 2023, 1:45 a.m. UTC | #1
On 2023-06-02 12:38, mwilck@suse.com wrote:
> From: Hannes Reinecke <hare@suse.de>
> 
> Larger setups may need to allocate more than 32k sg devices, so
> increase the number of devices to the full range of minor device
> numbers.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

Thanks.

> ---
>   drivers/scsi/sg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 037f8c98a6d3..6c04cf941dac 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -71,7 +71,7 @@ static int sg_proc_init(void);
>   
>   #define SG_ALLOW_DIO_DEF 0
>   
> -#define SG_MAX_DEVS 32768
> +#define SG_MAX_DEVS (1 << MINORBITS)
>   
>   /* 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. All SCSI commands greater
diff mbox series

Patch

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 037f8c98a6d3..6c04cf941dac 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -71,7 +71,7 @@  static int sg_proc_init(void);
 
 #define SG_ALLOW_DIO_DEF 0
 
-#define SG_MAX_DEVS 32768
+#define SG_MAX_DEVS (1 << MINORBITS)
 
 /* 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. All SCSI commands greater