Skip to contentSkip to conversation

sd: Why we need to call sd_revalidate_disk twice in sd_probe_async

DISCUSSION Jack Wang 2 participants 3 messages Nov 10, 2010 – Nov 11, 2010 SCSI

lore
Share & tools
lore

Jack Wang

author
#0 lore raw

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 <[email protected]>
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

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jack" == Jack Wang <[email protected]> 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?

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
author
#2 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Jack" == Jack Wang <[email protected]> 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

Signature · 1 line
Martin K. Petersen Oracle Linux Engineering