There is a small race window there. Please consider the following sequence.
1. drive sends SDB FIS with spurious completion in it.
2. block layer issues new r/w command to the drive. SDB FIS is still in
flight.
3. ata driver issues the command (the pending bit is set prior to
transmitting command FIS).
4. controller completes receiving FIS from #1. Driver reads the mask
and completes all indicated commands. If spurious completion in #1
happens to match the slot allocated in #3, the driver just completed a
command which hasn't been issued to the drive yet.
So, it actually is dangerous. We might even be seeing the real
completion as spurious one (as the command is completed prematurely).
It seems all those HTS541* drives share this problem. Four of them are
already on the blacklist and the other OS reportedly blacklists three of
them too. I'll submit a patch to add HTS541616J9SA00.
Thanks.
--
tejun
-