ext4: save all error info in save_error_info() and drop ext4_set_errno()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 28 Mar 2020 23:33:43 +0000 (19:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Apr 2020 21:29:06 +0000 (17:29 -0400)
commit54d3adbc29f0c7c53890da1683e629cd220d7201
tree485a4098e4523ed56c97b308c324f8cf91e5a51f
parentdf41460a21b06a76437af040d90ccee03888e8e5
ext4: save all error info in save_error_info() and drop ext4_set_errno()

Using a separate function, ext4_set_errno() to set the errno is
problematic because it doesn't do the right thing once
s_last_error_errorcode is non-zero.  It's also less racy to set all of
the error information all at once.  (Also, as a bonus, it shrinks code
size slightly.)

Link: https://lore.kernel.org/r/20200329020404.686965-1-tytso@mit.edu
Fixes: 878520ac45f9 ("ext4: save the error code which triggered...")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 files changed:
fs/ext4/balloc.c
fs/ext4/block_validity.c
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.c
fs/ext4/extents.c
fs/ext4/ialloc.c
fs/ext4/indirect.c
fs/ext4/inline.c
fs/ext4/inode.c
fs/ext4/mballoc.c
fs/ext4/mmp.c
fs/ext4/move_extent.c
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/xattr.c