On Sat, Jan 25, 2025 at 08:13:38AM +0700, Robert Elz wrote: > > | Now it is simply skipped with the same result. > > Not quite the same - previously once the drive was ready, wedge > discovery would happen.
At attach time a TEST UNIT READY command is sent to the drive. If it returns OK, the drive parameters are retrieved and shown Otherwise a message ("drive offline") or ("unformatted media") is reported. Then wedge discovery was done once and failed if the drive was offline. Now this is simply skipped. Nothing happens later "once the drive was ready". At open time, a TEST UNIT READY is done again, and drive parameters are retrieved when necessary. This actually makes it possible to use the device itself if it became online in between. But there is and was no wedge discovery at that time. What happens is a side effect. Wedge discovery itself opens the device. Besides the description above, this will also issue a START UNIT command to the drive when the (now second) TEST UNIT READY check failed (as well as a PREVENT MEDIUM REMOVAL command for a removable device). When START UNIT succeeds, it waits until the disk has started and then it usually is in online state. The attach code may also issue a START UNIT command, but this is only done as the very first thing when the device has set PQUIRK_START (that quirk is used for an Apple iPod). When wedge discovery was added, this effectively made all disks have the equivalent of PQUIRK_START. With the change that's no longer true and we are back to the original behaviour where a disk stays stopped until it is used (and then you need to discover wedges manually). Greetings, -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."