linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Battersby <tonyb@cybernetics.com>
To: James Bottomley <James.Bottomley@SteelEye.com>,
	Douglas Gilbert <dougg@torque.net>,
	linux-scsi@vger.kernel.org
Subject: [PATCH] fix /proc/scsi/sg/devices when no SCSI devices
Date: Tue, 22 Jan 2008 15:25:49 -0500	[thread overview]
Message-ID: <4796514D.6010908@cybernetics.com> (raw)

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);



             reply	other threads:[~2008-01-22 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 20:25 Tony Battersby [this message]
2008-01-22 22:11 ` [PATCH] fix /proc/scsi/sg/devices when no SCSI devices Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4796514D.6010908@cybernetics.com \
    --to=tonyb@cybernetics.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).