Il 17-08-2017 16:46 Tejun Heo ha scritto:
Upper layer can request to avoid retrying on errors but it won't help too much. It doesn't have much to do with specific commands. A power event can take place without any command in flight and lose the buffered data. Unless upper layer is tracking all that's being written, there isn't much it can do outside doing full scan. This is a condition which should be handled from the driver side.
True, I was not thinking about buffered (delayed) writes. However, for synchronized writes it should be possible: after all, for sync() writes the application is waiting for its completion. This means that if a powerloss/link renegotiation is detected between *the two FLUSH_CACHE commands*, and I/O error can be reported to the calling application.
What about disk supporting FUAs? Are they unaffected by this problem? If my understand it properly, torn writes remain a potential, but inevitable, problem when facing powerloss conditions.
By the way, when speaking about a "full scan" your are referring to full bus scanning/enumeration? Will it change devices name when re-discovering them?
Yeah, looking into getting it implemented on the kernel side.
Great! Are your thinking about a polling approach or an event-driven one?
Regards. -- Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: g.danti@xxxxxxxxxx - info@xxxxxxxxxx GPG public key ID: FF5F32A8