From: Mike Anderson <andmike@us.ibm.com>
To: sullivan <sullivan@austin.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] fix for sd removal loop
Date: Fri, 16 Aug 2002 12:23:12 -0700 [thread overview]
Message-ID: <20020816192312.GD1618@beaverton.ibm.com> (raw)
In-Reply-To: <20020816125256.E1216@austin.ibm.com>
Mike S,
While this fix solves the problem it looks odd to have a
signed value for an array size.
What about checking "sd_registered" just after
scsi_unregister_device in exit_sd.
-Mike A
sullivan [sullivan@austin.ibm.com] wrote:
> Attached is a trivial fix for an excessive loop that is encountered in
> removal of the sd module. This case is hit when sd is insmod'ed and rmmod'ed
> without any scsi devices being registered. In this case, within exit_sd(),
> sd_template.dev_max remains at zero and the N_USED_SD_MAJORS macro yields an
> incorrect result since it is treating dev_max as an signed number.
>
>
> diff -Nau --exclude='p.*' linux-2.5-devclass/drivers/scsi/hosts.h linux-2.5-devclass-mike/drivers/scsi/hosts.h
> --- linux-2.5-devclass/drivers/scsi/hosts.h Fri Aug 16 19:42:09 2002
> +++ linux-2.5-devclass-mike/drivers/scsi/hosts.h Wed Aug 14 23:32:55 2002
> @@ -519,7 +519,7 @@
> unsigned int max_major; /* Maximum major in range. */
> unsigned int nr_dev; /* Number currently attached */
> unsigned int dev_noticed; /* Number of devices detected. */
> - unsigned int dev_max; /* Current size of arrays */
> + signed int dev_max; /* Current size of arrays */
> unsigned blk:1; /* 0 if character device */
> int (*detect)(Scsi_Device *); /* Returns 1 if we can attach this device */
> int (*init)(void); /* Sizes arrays based upon number of devices
--
Michael Anderson
andmike@us.ibm.com
prev parent reply other threads:[~2002-08-16 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-16 17:52 [PATCH] fix for sd removal loop sullivan
2002-08-16 19:23 ` Mike Anderson [this message]
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=20020816192312.GD1618@beaverton.ibm.com \
--to=andmike@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=sullivan@austin.ibm.com \
/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