On Tue, 30 Mar 2021 19:47:27 +0800, Jason Yan wrote: > When the scsi device status is offline, mode sense command will return a > result with only DID_NO_CONNECT set. Then in sd_read_write_protect_flag(), > only status byte of the result is checked, we still consider the command > returned good, and read sdkp->write_prot from the buffer. And because of > bug [1], garbage data is copied to the buffer, the disk sometimes > be set readonly. When the scsi device is set running again, users cannot > write data to the disk. > > [...] Applied to 5.14/scsi-queue, thanks! [1/1] scsi: consider status is not good for offline devices https://git.kernel.org/mkp/scsi/c/1ee275342234 -- Martin K. Petersen Oracle Linux Engineering