mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
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@kernel.org Signed-off-by: Jeff Layton <jlayton@redhat.com> Reported-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5bdfca6435
commit
f4e222c56c
1 changed files with 8 additions and 0 deletions
|
@ -620,6 +620,14 @@ int file_check_and_advance_wb_err(struct file *file)
|
||||||
trace_file_check_and_advance_wb_err(file, old);
|
trace_file_check_and_advance_wb_err(file, old);
|
||||||
spin_unlock(&file->f_lock);
|
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;
|
return err;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(file_check_and_advance_wb_err);
|
EXPORT_SYMBOL(file_check_and_advance_wb_err);
|
||||||
|
|
Loading…
Reference in a new issue