From: Josef Bacik <jwhiter@redhat.com>
To: Josef Bacik <jwhiter@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
James Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] fix for async scsi scan sysfs problem (resend)
Date: Mon, 23 Apr 2007 14:13:19 -0400 [thread overview]
Message-ID: <20070423181318.GD22873@korben.rdu.redhat.com> (raw)
In-Reply-To: <20070421135956.GA22873@korben.rdu.redhat.com>
On Sat, Apr 21, 2007 at 09:59:56AM -0400, Josef Bacik wrote:
> On Sat, Apr 21, 2007 at 12:23:45AM -0700, Andrew Morton wrote:
> > On Thu, 19 Apr 2007 11:06:56 -0400 Josef Bacik <jwhiter@redhat.com> wrote:
> >
> > > On Thu, Apr 19, 2007 at 10:02:36AM -0400, James Bottomley wrote:
> > > > On Thu, 2007-04-19 at 09:25 -0400, Josef Bacik wrote:
> > > > > Looking through everything I came to the conclusion that we don't really need
> > > > > the scsi_sysfs_add_devices in scsi_finish_async_scan, which gets run everytime
> > > > > we do a do_scan_async. In doing the scanning, if we come upon anything we will
> > > > > already be registering the device with sysfs so the scsi_sysfs_add_devices step
> > > > > is kind of useless.
> > > >
> > > > Unfortunately, it isn't. The registration step while scanning is at the
> > > > end of scsi_add_lun():
> > > >
> > > >
> > > > if (!async && scsi_sysfs_add_sdev(sdev) != 0)
> > > > return SCSI_SCAN_NO_RESPONSE;
> > > >
> > > > return SCSI_SCAN_LUN_PRESENT;
> > > >
> > > > The !async should mean that the addition *only* occurs for the non async
> > > > scan case ... if you remove the post async scan add, we'll lose devices.
> > > >
Ok I have a new patch that I've built and tested on both my UP and SMP machine
and it appears to work fine. I took the async check out of scsi_add_lun, I
don't really see the point in waiting to do the sysfs registration stuff (if
theres a reason I haven't been able to find it in the original submission of
this functionality). Please let me know if this is incorrect. Thank you,
Josef
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0949145..8af1e16 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -712,7 +712,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
* SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
**/
static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
- int *bflags, int async)
+ int *bflags)
{
/*
* XXX do not save the inquiry, since it can change underneath us,
@@ -912,7 +912,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
* register it and tell the rest of the kernel
* about it.
*/
- if (!async && scsi_sysfs_add_sdev(sdev) != 0)
+ if (scsi_sysfs_add_sdev(sdev) != 0)
return SCSI_SCAN_NO_RESPONSE;
return SCSI_SCAN_LUN_PRESENT;
@@ -1081,7 +1081,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
goto out_free_result;
}
- res = scsi_add_lun(sdev, result, &bflags, shost->async_scan);
+ res = scsi_add_lun(sdev, result, &bflags);
if (res == SCSI_SCAN_LUN_PRESENT) {
if (bflags & BLIST_KEY) {
sdev->lockable = 0;
@@ -1661,15 +1661,6 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
return 0;
}
-static void scsi_sysfs_add_devices(struct Scsi_Host *shost)
-{
- struct scsi_device *sdev;
- shost_for_each_device(sdev, shost) {
- if (scsi_sysfs_add_sdev(sdev) != 0)
- scsi_destroy_sdev(sdev);
- }
-}
-
/**
* scsi_prep_async_scan - prepare for an async scan
* @shost: the host which will be scanned
@@ -1741,8 +1732,6 @@ static void scsi_finish_async_scan(struct async_scan_data *data)
wait_for_completion(&data->prev_finished);
- scsi_sysfs_add_devices(shost);
-
spin_lock(&async_scan_lock);
shost->async_scan = 0;
list_del(&data->list);
next prev parent reply other threads:[~2007-04-23 18:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-19 13:25 Josef Bacik
2007-04-19 14:02 ` James Bottomley
2007-04-19 15:06 ` Josef Bacik
2007-04-21 7:23 ` Andrew Morton
2007-04-21 13:59 ` Josef Bacik
2007-04-23 18:13 ` Josef Bacik [this message]
2007-04-23 18:26 ` James Bottomley
2007-05-03 20:00 ` James Smart
2007-08-11 15:04 ` Jurij Smakov
2007-08-13 0:26 ` Matthew Wilcox
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=20070423181318.GD22873@korben.rdu.redhat.com \
--to=jwhiter@redhat.com \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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
Powered by JetHome