Re: [PATCH RESEND v2] scsi: ignore Synchronize Cache command failures to keep using drives not supporting it
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: 2021-02-28 16:38:01
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: 2021-02-28 16:38:01
On Sun, 2021-02-28 at 10:01 +0100, Guido Trentalancia wrote:
Many obsolete hard drives do not support the Synchronize Cache SCSI command. Such command is generally issued during fsync() calls which at the moment therefore fail with the ILLEGAL_REQUEST sense key.
It should be that all drives that don't support sync cache also don't have write back caches, which means we don't try to do a cache sync on them. The only time you we ever try to sync the cache is if the device advertises a write back cache, in which case the sync cache command is mandatory. I'm sure some SATA manufacturers somewhere cut enough corners to produce an illegally spec'd drive like this, but your proposed remedy is unviable: you can't ignore a cache failure on flush barriers which will cause data corruption. You have to disable barriers on the filesystem to get correct operation and be very careful about power down. James