On Tue 18-07-17 09:39:35, Lukas Czerner wrote: > On Mon, Jul 17, 2017 at 11:39:09AM -0400, 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. > > I think it can be read if we wrote into already allocated space. > > > > > 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. > > That's part of the reason why I did it unconditionaly as well, however > Jan is right that ret would be negative. The way to fix it would differ > depending on whether I am right about reading partially written data > from AIO that failed. We still want to invalidate in that case. Frankly, I don't think it really matters so I'd go for not invalidating anything on error just out of philosophy: "There's something weird going on, bail out as quickly as you can." Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR