The patch titled Subject: mm: have filemap_check_and_advance_wb_err clear AS_EIO/AS_ENOSPC has been added to the -mm tree. Its filename is mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jeff Layton <jlayton@xxxxxxxxxx> Subject: mm: have filemap_check_and_advance_wb_err clear AS_EIO/AS_ENOSPC Eryu noticed that he could sometimes get a leftover error reported when it shouldn't be on fsync with ext2 and non-journalled ext4. The problem is that writeback_single_inode still uses filemap_fdatawait. That picks up a previously set AS_EIO flag, which would ordinarily have been cleared before. Since we're mostly using this function as a replacement for filemap_check_errors, have filemap_check_and_advance_wb_err clear AS_EIO and AS_ENOSPC when reporting an error. That should allow the new function to better emulate the behavior of the old with respect to these flags. Link: http://lkml.kernel.org/r/20170922133331.28812-1-jlayton@xxxxxxxxxx Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> Reported-by: Eryu Guan <eguan@xxxxxxxxxx> Reviewed-by: Jan Kara <jack@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/filemap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN mm/filemap.c~mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc mm/filemap.c --- a/mm/filemap.c~mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc +++ a/mm/filemap.c @@ -620,6 +620,14 @@ int file_check_and_advance_wb_err(struct trace_file_check_and_advance_wb_err(file, old); spin_unlock(&file->f_lock); } + + /* + * We're mostly using this function as a drop in replacement for + * filemap_check_errors. Clear AS_EIO/AS_ENOSPC to emulate the effect + * that the legacy code would have had on these flags. + */ + clear_bit(AS_EIO, &mapping->flags); + clear_bit(AS_ENOSPC, &mapping->flags); return err; } EXPORT_SYMBOL(file_check_and_advance_wb_err); _ Patches currently in -mm which might be from jlayton@xxxxxxxxxx are mm-have-filemap_check_and_advance_wb_err-clear-as_eio-as_enospc.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html