Bug 203635

Summary: SCSI Disk driver does not support obsolete hard-disk drives that lack the Synchronize Cache command
Product: SCSI Drivers Reporter: Guido Trentalancia (guido2022)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: high CC: guido2022
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://lore.kernel.org/patchwork/patch/1052770/
Kernel Version: 4.10 to 5.2 Subsystem:
Regression: No Bisected commit-id:
Attachments: Proposed patch (v2)
Proposed patch (v2)

Description Guido Trentalancia 2019-05-17 17:34:14 UTC
Created attachment 282811 [details]
Proposed patch (v2)

The current Linux kernel SCSI Disk driver does not support obsolete hard-disk drives that lack the Synchronize Cache command.

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.

Since this failure is currently treated as critical in the kernel SCSI
disk driver, such obsolete hard drives cannot be used anymore (at least
since kernel 4.10, maybe even earlier): they cannot be formatted,
mounted and/or checked using tools such as e2fsprogs.

Because there is nothing which can be done if the drive does not support
such command, such ILLEGAL_REQUEST should be treated as non-critical so
that the underlying operation does not fail and the obsolete hard drive
can be used normally.

This second version of the patch (v2) disables the Write Cache feature
as a precaution on hard drives which do not support the Synchronize Cache
command and therefore the cache flushing functionality.
Comment 1 Guido Trentalancia 2019-12-09 10:11:07 UTC
Created attachment 286233 [details]
Proposed patch (v2)

Proposed patch (v2) - improved patch description