public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Vladislav Bolkhovitine <vlls@hotbox.ru>
Cc: linux-scsi@vger.kernel.org, nahshon@actcom.co.il, zaitcev@redhat.com
Subject: Re: [PATCH] SCSI host ID assigment overoptimization removal in 2.4.18
Date: Sat, 20 Jul 2002 19:49:42 -0400	[thread overview]
Message-ID: <20020720194942.B20953@devserv.devel.redhat.com> (raw)

> --- linux-2.4.18-enc.orig/drivers/scsi/hosts.c  Wed Jul 17 12:49:51 2002
> +++ linux-2.4.18-enc.register_kmalloc/drivers/scsi/hosts.c      Thu Jul 18 15:47:51 \
> 2002 @@ -174,6 +186,12 @@
>                  return NULL;
>          }
>         shn->name = kmalloc(hname_len + 1, GFP_ATOMIC);
> +       if (!shn->name) {
> +               kfree(retval);
> +               kfree(shn);
> +               printk(KERN_ERR "scsi: out of memory(3) in scsi_register.\n");
> +               return NULL;
> +        }
>         if (hname_len > 0)
>             strncpy(shn->name, hname, hname_len);
>         shn->name[hname_len] = 0;

Does it solve the same problem as the following? It looks like
it does, only in a different place. Which one is better?

--- drivers/scsi/hosts.c.orig   Mon Feb 25 21:38:04 2002
+++ drivers/scsi/hosts.c        Wed Apr 17 01:42:47 2002
@@ -81,8 +81,8 @@
 struct Scsi_Host * scsi_hostlist;
 struct Scsi_Device_Template * scsi_devicelist;

-int max_scsi_hosts;
-int next_scsi_host;
+int max_scsi_hosts;    /* host_no for next new host */
+int next_scsi_host;    /* count of registered scsi hosts */

 void
 scsi_unregister(struct Scsi_Host * sh){
@@ -107,21 +107,8 @@
     if (shn) shn->host_registered = 0;
     /* else {} : This should not happen, we should panic here... */

-    /* If we are removing the last host registered, it is safe to reuse
-     * its host number (this avoids "holes" at boot time) (DB)
-     * It is also safe to reuse those of numbers directly below which have
-     * been released earlier (to avoid some holes in numbering).
-     */
-    if(sh->host_no == max_scsi_hosts - 1) {
-       while(--max_scsi_hosts >= next_scsi_host) {
-           shpnt = scsi_hostlist;
-           while(shpnt && shpnt->host_no != max_scsi_hosts - 1)
-               shpnt = shpnt->next;
-           if(shpnt)
-               break;
-       }
-    }
     next_scsi_host--;
+
     kfree((char *) sh);
 }


See:
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0206.0/1220.html

I poked Marcelo with it for Itai, and he said to wait for 2.4.20
to open. Currently we ship Itai's variant.

-- Pete

             reply	other threads:[~2002-07-20 23:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-20 23:49 Pete Zaitcev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-07-22 12:15 [PATCH] SCSI host ID assigment overoptimization removal in 2.4.18 Aron Zeh
2002-07-19  7:09 Aron Zeh
2002-07-19  7:42 ` Vladislav Bolkhovitine
2002-07-18 11:22 Vladislav Bolkhovitine
2002-07-18 19:45 ` Luben Tuikov
2002-07-21  1:02 ` Itai Nahshon

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=20020720194942.B20953@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nahshon@actcom.co.il \
    --cc=vlls@hotbox.ru \
    /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