add patch treat-buffers-with-write-errors-as-contining-valid-data