On Mon, 01/03/2021 at 12.42 +0000, Damien Le Moal wrote: > I checked the standards again. It turns out that SYNCHRONIZE CACHE > command is > optional in SBC... Aouch. Got so used to have that one on any drive > that I > thought it was mandatory. > > Well, it certainly is mandatory if the drive has a write cache, which > seems to > be the case for you. > > The problem with your patch though is that you disable write caching > when you > see an ILLEGAL REQUEST/INVALID OPCODE termination of synchronize > cache. Which > means that the drive was already used, written too and the cache has > likely > dirty data and I do not see any method to guarantee that that data > makes it to > persistent media before shutdown. Imagine if that was the synchronize > cache sent > before shutdown. As already said, I have tested the patch for over a year now and I have never experienced the problem that you are foreseeing ! The current alternative is data corruption each time that the drive is mounted and the inability to use it. So, the patch is the way forward for using such drives plug and play without cumbersome configuration such as disabling the write cache, which advanced users can always make. > So the only reasonable solution for such drive is to use it with > write cache > disabled from the start. > down. It works well even with write caching enabled. If you have an alternative patch to propose, go ahead otherwise I would push for getting this merged and sorting out the issue for good. Guido