Jan Kara <jack@xxxxxxx> writes: > On Mon 17-07-17 11:39:09, Jeff Moyer wrote: >> Lukas Czerner <lczerner@xxxxxxxxxx> writes: >> >> > About the error case, is it not possible that some data has already been >> > writtent to the disk despite the error ? >> >> Yes, it's possible. However, that data is in an inconsistent state, so >> it shouldn't be read, anyway. >> >> Now, in the non-async path, we do the invalidation unconditionally, so I >> could go either way on this. I don't think it's going to matter for >> performance or data integrity. > > Well, at least 'ret' would be negative in the error case so arguments > passed to invalidate_inode_pages2_range() would be bogus if I'm reading the > code right... Ah, yes. Sorry, I was commenting on the more general point. You are correct, in dio_complete, ret could be set to dio->page_errors or dio->io_error. So yes, that needs to be checked. -Jeff