Ok, so the problem is that udisks tries to update the drive's SMART status every 10 minutes. This will wake the drive and reset its standby timer. It does check to see if the drive is already asleep first, and skips the check if it is, but that doesn't help if the standby timer is > 10 minutes. It also seems that my Western Digital drives also refuse to standby in under 10 minutes; setting it to 5 minutes still makes it wait just over 10. This is why my patch to switch to the STANDBY command appeared to fix it at first: by immediately putting the drive into standby, it made the SMART updates be skipped.
You can verify this by killing the udisksd process and you can see the drive does spin down after just over 10 minutes.
The proper fix for this is to add another check to see if there has been any IO since the last SMART update according to the kernel performance counters, and if not, skip the update.
Ok, so the problem is that udisks tries to update the drive's SMART status every 10 minutes. This will wake the drive and reset its standby timer. It does check to see if the drive is already asleep first, and skips the check if it is, but that doesn't help if the standby timer is > 10 minutes. It also seems that my Western Digital drives also refuse to standby in under 10 minutes; setting it to 5 minutes still makes it wait just over 10. This is why my patch to switch to the STANDBY command appeared to fix it at first: by immediately putting the drive into standby, it made the SMART updates be skipped.
You can verify this by killing the udisksd process and you can see the drive does spin down after just over 10 minutes.
The proper fix for this is to add another check to see if there has been any IO since the last SMART update according to the kernel performance counters, and if not, skip the update.