On Tue, Jul 03, 2018 at 03:05:01PM -0700, Darrick J. Wong wrote: > > So the buffer completion code clears the uptodate status of the buffer > > on error. I assume that means the next read would replace the data we > > failed to write with whatever was previously on disk. > > I've always found it a little weird that we basically throw away the > newer page contents on error, but we shouldn't be changing the behavior > in quite so subtle a way. > > Also, since we clear uptodate the next (buffered) write will reread the > page contents. > > > I guess it's debatable whether that is the right thing to do in > > general, but that seems like a higher level issue nonetheless (i.e., I > > don't think we'd ever retry the writepage either?). > > AFAIK we don't retry failed writes unless userspace dirties the page. > > > So is there any reason not to do the analogous in the iomap completion > > code? > > Will let Christoph answer that one. As far as I can tell the write path should never even touch the uptodate bit, and the buffer head path is only doing so for very old legacy reasons. I'd rather keep the iomap write path out of the update bit manipulation business from the very beginning instead of carry junk like this over.