From: Patrick Mansfield <patmans@us.ibm.com>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: 2 questions about SCSI initialization
Date: Thu, 21 Mar 2002 14:26:35 -0800 [thread overview]
Message-ID: <20020321142635.A6555@eng2.beaverton.ibm.com> (raw)
In-Reply-To: <20020321000553.A6704@devserv.devel.redhat.com>
On Thu, Mar 21, 2002 at 12:05:53AM -0500, Pete Zaitcev wrote:
> #2: What does if (GET_USE_COUNT(tpnt->module) != 0) do in
> scsi_unregister_device? The circomstances are truly bizzare:
> a) the error code is NEVER used
> b) it can be called either from module unload.
> I would like to kill that check.
Is sd (or sg or whatever) *not* a module in your case?
I think the check is buggy, as it doesn't validate tpnt->module,
IMO you ought to add a check for tpnt->module, and call BUG()
rather than completely removing the check, see the patch below.
If the count is really non zero, the function should not be called
(rmmod won't call into it if the module is in use; if calling via
scsi_register_device_module on failure, it should be impossible
to increment count - it should be impossible to call sd_open or
sg_open).
Here's a patch against 2.4.18:
--- scsi.c.orig Thu Mar 21 13:51:27 2002
+++ scsi.c Thu Mar 21 13:52:54 2002
@@ -2331,8 +2331,8 @@
/*
* If we are busy, this is not going to fly.
*/
- if (GET_USE_COUNT(tpnt->module) != 0)
- goto error_out;
+ if (tpnt->module && (GET_USE_COUNT(tpnt->module) != 0))
+ BUG();
/*
* Next, detach the devices from the driver.
@@ -2366,9 +2366,6 @@
* cleanup function.
*/
return 0;
-error_out:
- unlock_kernel();
- return -1;
}
-- Patrick Mansfield
next prev parent reply other threads:[~2002-03-21 22:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-21 5:05 Pete Zaitcev
2002-03-21 13:57 ` Douglas Gilbert
2002-03-21 14:32 ` Alan Cox
2002-03-22 0:19 ` Pete Zaitcev
2002-03-22 8:37 ` Pete Zaitcev
2002-03-21 22:26 ` Patrick Mansfield [this message]
2002-03-22 0:04 ` Pete Zaitcev
2002-03-22 1:27 ` Patrick Mansfield
2002-03-22 1:44 ` 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=20020321142635.A6555@eng2.beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=zaitcev@redhat.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
all inboxes | Powered by JetHome®