mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Itai Nahshon <nahshon@actcom.co.il>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Richard Gooch <rgooch@ras.ucalgary.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SCSI host numbers?
Date: Thu, 3 Jan 2002 01:35:32 +0200	[thread overview]
Message-ID: <200201022335.g02NZaj10253@lmail.actcom.co.il> (raw)
In-Reply-To: <E16LjdE-0003m4-00@the-village.bc.nu>
In-Reply-To: <E16LjdE-0003m4-00@the-village.bc.nu>

On Wednesday 02 January 2002 01:32 pm, Alan Cox wrote:
> > Under some scenarios Linux assigns the same
> > host_no to more than one scsi device.
> >
> > Can someone tell me what is the intended behavior?
>
> A number should never be reissued.
>
> > The problem is that a newly registered device gets
> > its host_no from max_scsi_host. max_scsi_host is
> > decremented when a device driver is unregistered
> > (see drivers/scsi/host.c) allowing a second new
> > host to reuse the same host_no.
>
> I guess it needs to either only decrement the count if we are the highest

I'll argue that it should never decrement. The host that was just
unregisrtered already has its host_id reserved and if we decrement,
this number will be reasigned to the next new scsi host.

Unless if the code for reservation that causes the conflicts
is removed (but I guess it has a reason).

> one (trivial hack) or scan for a free number/keep a free bitmap. The devfs
> code has a handy little unique_id function for that

That would not solve it. The problem is that one piece of code
tries to allocate unique numbers (and get them back to the pool
when they are not in use), another piece of code remembers the
old number that a scsi host had and whan it re-registers gives
it back its old host_no regardless if this number was re-assigned
to a new host.

Is there a function that given a string returns a unique number
for this string? That would do the job.

-- Itai



  reply	other threads:[~2002-01-02 23:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-02  1:19 Itai Nahshon
2002-01-02 11:32 ` Alan Cox
2002-01-02 23:35   ` Itai Nahshon [this message]
2002-01-06  1:44   ` Richard Gooch
2002-01-13 20:41     ` Itai Nahshon
2002-01-14  6:36     ` Richard Gooch
2002-01-15 12:19       ` Itai Nahshon
2002-01-16  7:03       ` Richard Gooch
2002-01-16  9:47         ` Itai Nahshon
2002-03-21 21:48           ` [PATCH] [was SCSI host numbers? ] Itai Nahshon
2002-01-02 19:31 ` SCSI host numbers? Richard Gooch
2002-01-02 21:01   ` Alan Cox
2002-01-02 21:18   ` Richard Gooch
     [not found] <mailman.1009934881.4099.linux-kernel2news@redhat.com>
2002-01-02  2:07 ` Pete Zaitcev

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=200201022335.g02NZaj10253@lmail.actcom.co.il \
    --to=nahshon@actcom.co.il \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@ras.ucalgary.ca \
    /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

all inboxes | Powered by JetHome®