question on hot plug removal and addition of a USB disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I sent the below query to linux-scsi. Thought it would be better to check on the linux-hotplug mailing list.
Can you please provide the details of the expected behavior, and where in the code should I look for details?

Thanks and Regards,
- Kishore

-----Original Message-----
From: Sampathkumar, Kishore 
Sent: Wednesday, September 14, 2011 7:47 PM
To: 'linux-scsi@xxxxxxxxxxxxxxx'
Subject: question on hot plug removal and addition of a USB disk

Scenario: I have a file system on a USB SCSI disk /dev/sdb mounted on /mnt.
I perform Action 1 below, and after some time, perform Action 2 below.

Action 1: removal (unplug) of a USB disk

At the time of removal of the USB disk, since the file system was mounted, is the reference to kobject corresponding (now orphaned) sdb still maintained in the kernel, although /dev/sdb is gone due to disk removal?

Is it that the old scsi_disk (sdb) still persists, but, the underlying scsi_dev is removed? Where should I start to trace the hotplug removal of the USB disk? What are the specific processing steps involved in the kernel to handle this (in terms of main routines handling this)?

Action 2: (hot) plug addition of the same USB SCSI disk

On plugging in the same USB SCSI disk, does the sd layer in scsi subsystem grab the first available 'free' sdX device (say sdp), given that sdb is still being referenced by the mounted file system?

Again, in terms of code, does this correspond to:
-	a new scsi_dev being allocated
-	a corresponding scsi_disk for sdp being allocated by the sd layer in scsi subsystem as part of 'probe' for the added SCSI device

Does the hot plugging work the same way for SAS disks attached behind a FC switch?

Thanks,
-	Kishore
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux