linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix /proc/scsi/sg/devices when no SCSI devices
@ 2008-01-22 20:25 Tony Battersby
  2008-01-22 22:11 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Battersby @ 2008-01-22 20:25 UTC (permalink / raw)
  To: James Bottomley, Douglas Gilbert, linux-scsi

The patch "[SCSI] sg: use idr to replace static arrays" in 2.6.24-rc1
causes a bogus line to appear in /proc/scsi/sg/devices containing
"-1 -1 -1 -1 -1 -1 -1 -1 -1" when there are no SCSI devices in the
system.  In 2.6.23, /proc/scsi/sg/devices is empty when there are no
SCSI devices in the system.  A similar problem exists with
/proc/scsi/sg/device_strs.  The following patch restores the behavior
of 2.6.23.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
---
--- linux-2.6.24-rc8-git5/drivers/scsi/sg.c.orig	2008-01-22 15:08:46.000000000 -0500
+++ linux-2.6.24-rc8-git5/drivers/scsi/sg.c	2008-01-22 15:09:05.000000000 -0500
@@ -2521,7 +2521,7 @@ sg_idr_max_id(int id, void *p, void *dat
 static int
 sg_last_dev(void)
 {
-	int k = 0;
+	int k = -1;
 	unsigned long iflags;
 
 	read_lock_irqsave(&sg_index_lock, iflags);



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix /proc/scsi/sg/devices when no SCSI devices
  2008-01-22 20:25 [PATCH] fix /proc/scsi/sg/devices when no SCSI devices Tony Battersby
@ 2008-01-22 22:11 ` Douglas Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Douglas Gilbert @ 2008-01-22 22:11 UTC (permalink / raw)
  To: Tony Battersby; +Cc: James Bottomley, linux-scsi

Tony Battersby wrote:
> The patch "[SCSI] sg: use idr to replace static arrays" in 2.6.24-rc1
> causes a bogus line to appear in /proc/scsi/sg/devices containing
> "-1 -1 -1 -1 -1 -1 -1 -1 -1" when there are no SCSI devices in the
> system.  In 2.6.23, /proc/scsi/sg/devices is empty when there are no
> SCSI devices in the system.  A similar problem exists with
> /proc/scsi/sg/device_strs.  The following patch restores the behavior
> of 2.6.23.
> 
> Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
> ---
> --- linux-2.6.24-rc8-git5/drivers/scsi/sg.c.orig	2008-01-22 15:08:46.000000000 -0500
> +++ linux-2.6.24-rc8-git5/drivers/scsi/sg.c	2008-01-22 15:09:05.000000000 -0500
> @@ -2521,7 +2521,7 @@ sg_idr_max_id(int id, void *p, void *dat
>  static int
>  sg_last_dev(void)
>  {
> -	int k = 0;
> +	int k = -1;
>  	unsigned long iflags;
>  
>  	read_lock_irqsave(&sg_index_lock, iflags);
> 
> 
> -

Tony,
Thanks.

Signed-off-by: Douglas Gilbert <dougg@torque.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-22 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-22 20:25 [PATCH] fix /proc/scsi/sg/devices when no SCSI devices Tony Battersby
2008-01-22 22:11 ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).