public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* sd: Why we need to call sd_revalidate_disk twice in sd_probe_async
@ 2010-11-10  7:21 Jack Wang
  2010-11-10 10:11 ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Wang @ 2010-11-10  7:21 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi, martin.petersen

 
Hi all

I notice in sd.c, we call sd_revalidate_disk twice in function
sd_probe_async?  Are there some special reasons? I track the git history,
and found the second one is add by From
3821d768912a47ddbd6cab52943a8284df88003c Mon Sep 17 00:00:00 2001
From: Martin K. Petersen <martin.petersen@oracle.com>
Date: Sat, 23 May 2009 11:43:38 -0400
Subject: [PATCH] sd: Detect non-rotational devices

Detect non-rotational devices and set the queue flag accordingly.

Could anyone tell me why?

Thanks
Jack


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sd: Why we need to call sd_revalidate_disk twice in sd_probe_async
  2010-11-10  7:21 sd: Why we need to call sd_revalidate_disk twice in sd_probe_async Jack Wang
@ 2010-11-10 10:11 ` Martin K. Petersen
  2010-11-11  0:31   ` jack_wang
  0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2010-11-10 10:11 UTC (permalink / raw)
  To: Jack Wang; +Cc: James.Bottomley, linux-scsi, martin.petersen

>>>>> "Jack" == Jack Wang <jack_wang@usish.com> writes:

Jack> I notice in sd.c, we call sd_revalidate_disk twice in function
Jack> sd_probe_async?  Are there some special reasons?

I'm traveling right now and don't have my scribbles. But my recollection
is that it's due to a quirk in the way things are registered with the
block layer. Some limits are hanging off of the request queue and some
off of struct gendisk.

For stacking purposes we need to set some queue defaults before we
register the gendisk. And then we do a second revalidate pass to get
everything in place after the gendisk has been set up. Alignment
offsets, for instance, need to be updated after the partition table has
been read.

So, yes. It is intentional that revalidate is called both before and
after add_disk().

If this causing you problems? And if so, why?

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: sd: Why we need to call sd_revalidate_disk twice in sd_probe_async
  2010-11-10 10:11 ` Martin K. Petersen
@ 2010-11-11  0:31   ` jack_wang
  0 siblings, 0 replies; 3+ messages in thread
From: jack_wang @ 2010-11-11  0:31 UTC (permalink / raw)
  Cc: James.Bottomley@suse.de, linux-scsi@vger.kernel.org,
	martin.petersen@oracle.com


 
>>>>> "Jack" == Jack Wang <jack_wang@usish.com> writes:
Jack> I notice in sd.c, we call sd_revalidate_disk twice in function
Jack> sd_probe_async?  Are there some special reasons?
I'm traveling right now and don't have my scribbles. But my recollection
is that it's due to a quirk in the way things are registered with the
block layer. Some limits are hanging off of the request queue and some
off of struct gendisk.
For stacking purposes we need to set some queue defaults before we
register the gendisk. And then we do a second revalidate pass to get
everything in place after the gendisk has been set up. Alignment
offsets, for instance, need to be updated after the partition table has
been read.
So, yes. It is intentional that revalidate is called both before and
after add_disk().
If this causing you problems? And if so, why?


Hi, Martin

Thanks for explaination, I just curious about the duplicated call, No problems found.

Jack
-- 
Martin K. Petersen Oracle Linux Engineering



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-11  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10  7:21 sd: Why we need to call sd_revalidate_disk twice in sd_probe_async Jack Wang
2010-11-10 10:11 ` Martin K. Petersen
2010-11-11  0:31   ` jack_wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox