* [PATCH] fix for sd removal loop
@ 2002-08-16 17:52 sullivan
2002-08-16 19:23 ` Mike Anderson
0 siblings, 1 reply; 2+ messages in thread
From: sullivan @ 2002-08-16 17:52 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 372 bytes --]
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.
[-- Attachment #2: linux-2.5-devclass-hosts.patch --]
[-- Type: text/plain, Size: 783 bytes --]
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix for sd removal loop
2002-08-16 17:52 [PATCH] fix for sd removal loop sullivan
@ 2002-08-16 19:23 ` Mike Anderson
0 siblings, 0 replies; 2+ messages in thread
From: Mike Anderson @ 2002-08-16 19:23 UTC (permalink / raw)
To: sullivan; +Cc: linux-scsi
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-16 19:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-16 17:52 [PATCH] fix for sd removal loop sullivan
2002-08-16 19:23 ` Mike Anderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.