|
48 | 48 | #include <linux/fsnotify.h> |
49 | 49 | #include <linux/fs_context.h> |
50 | 50 | #include <linux/fs_parser.h> |
| 51 | +#include <linux/fserror.h> |
51 | 52 |
|
52 | 53 | #include "ext4.h" |
53 | 54 | #include "ext4_extents.h" /* Needed for trace points definition */ |
@@ -824,7 +825,8 @@ void __ext4_error(struct super_block *sb, const char *function, |
824 | 825 | sb->s_id, function, line, current->comm, &vaf); |
825 | 826 | va_end(args); |
826 | 827 | } |
827 | | - fsnotify_sb_error(sb, NULL, error ? error : EFSCORRUPTED); |
| 828 | + fserror_report_metadata(sb, error ? -abs(error) : -EFSCORRUPTED, |
| 829 | + GFP_ATOMIC); |
828 | 830 |
|
829 | 831 | ext4_handle_error(sb, force_ro, error, 0, block, function, line); |
830 | 832 | } |
@@ -856,7 +858,9 @@ void __ext4_error_inode(struct inode *inode, const char *function, |
856 | 858 | current->comm, &vaf); |
857 | 859 | va_end(args); |
858 | 860 | } |
859 | | - fsnotify_sb_error(inode->i_sb, inode, error ? error : EFSCORRUPTED); |
| 861 | + fserror_report_file_metadata(inode, |
| 862 | + error ? -abs(error) : -EFSCORRUPTED, |
| 863 | + GFP_ATOMIC); |
860 | 864 |
|
861 | 865 | ext4_handle_error(inode->i_sb, false, error, inode->i_ino, block, |
862 | 866 | function, line); |
@@ -896,7 +900,7 @@ void __ext4_error_file(struct file *file, const char *function, |
896 | 900 | current->comm, path, &vaf); |
897 | 901 | va_end(args); |
898 | 902 | } |
899 | | - fsnotify_sb_error(inode->i_sb, inode, EFSCORRUPTED); |
| 903 | + fserror_report_file_metadata(inode, -EFSCORRUPTED, GFP_ATOMIC); |
900 | 904 |
|
901 | 905 | ext4_handle_error(inode->i_sb, false, EFSCORRUPTED, inode->i_ino, block, |
902 | 906 | function, line); |
@@ -965,7 +969,8 @@ void __ext4_std_error(struct super_block *sb, const char *function, |
965 | 969 | printk(KERN_CRIT "EXT4-fs error (device %s) in %s:%d: %s\n", |
966 | 970 | sb->s_id, function, line, errstr); |
967 | 971 | } |
968 | | - fsnotify_sb_error(sb, NULL, errno ? errno : EFSCORRUPTED); |
| 972 | + fserror_report_metadata(sb, errno ? -abs(errno) : -EFSCORRUPTED, |
| 973 | + GFP_ATOMIC); |
969 | 974 |
|
970 | 975 | ext4_handle_error(sb, false, -errno, 0, 0, function, line); |
971 | 976 | } |
|
0 commit comments