diff options
author | Theodore Ts'o <tytso@mit.edu> | 2019-11-20 05:54:15 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-12-26 19:28:23 +0300 |
commit | 878520ac45f9f698432d4276db3d9144b83931b6 (patch) | |
tree | 4d2eb8c8fd49bd852ca2be77e53798fa4b19dbdd /fs/ext4/xattr.c | |
parent | a562c687d115fe5a90be1e27745cc771c1e6cbd9 (diff) | |
download | linux-878520ac45f9f698432d4276db3d9144b83931b6.tar.xz |
ext4: save the error code which triggered an ext4_error() in the superblock
This allows the cause of an ext4_error() report to be categorized
based on whether it was triggered due to an I/O error, or an memory
allocation error, or other possible causes. Most errors are caused by
a detected file system inconsistency, so the default code stored in
the superblock will be EXT4_ERR_EFSCORRUPTED.
Link: https://lore.kernel.org/r/20191204032335.7683-1-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 8966a5439a22..246fbeeb6366 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -2879,9 +2879,11 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode, bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO); if (IS_ERR(bh)) { error = PTR_ERR(bh); - if (error == -EIO) + if (error == -EIO) { + ext4_set_errno(inode->i_sb, EIO); EXT4_ERROR_INODE(inode, "block %llu read error", EXT4_I(inode)->i_file_acl); + } bh = NULL; goto cleanup; } |