On Sat 06-04-19 15:13:13, ZhangXiaoxu wrote:I encountered this situation when using iscsi target as the ext4 volume,
When the buffer write failed, 'end_buffer_write_sync' andThanks for the patch. But what are the chances that after the write has
'end_buffer_async_write' will clear the uptodate flag. But the
data in the buffer maybe newer than disk. In some case, this
will lead data corruption.
For example: ext4 flush metadata to disk failed, it will clear
the uptodate flag. when a new coming call want the buffer, it will
read it from the disk(because the buffer no uptodate flag). But
the journal not checkpoint now, it will read old data from disk.
If read successfully, ext4 will write the old data to the new
journal, the data will corruption.
So, don't clear the uptodate flag when write the buffer failed.
Signed-off-by: ZhangXiaoxu<zhangxiaoxu5@xxxxxxxxxx>
failed the read will succeed? Also there were places that were using
buffer_uptodate() to detect IO errors. Did you check all those got
converted to using buffer_write_io_error() instead?
Honza