Merge tag 'core-rcu-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / fs / ext4 / block_validity.c
index 0a734ff..16e9b2f 100644 (file)
@@ -166,10 +166,8 @@ static int ext4_data_block_valid_rcu(struct ext4_sb_info *sbi,
 
        if ((start_blk <= le32_to_cpu(sbi->s_es->s_first_data_block)) ||
            (start_blk + count < start_blk) ||
-           (start_blk + count > ext4_blocks_count(sbi->s_es))) {
-               sbi->s_es->s_last_error_block = cpu_to_le64(start_blk);
+           (start_blk + count > ext4_blocks_count(sbi->s_es)))
                return 0;
-       }
 
        if (system_blks == NULL)
                return 1;
@@ -181,10 +179,8 @@ static int ext4_data_block_valid_rcu(struct ext4_sb_info *sbi,
                        n = n->rb_left;
                else if (start_blk >= (entry->start_blk + entry->count))
                        n = n->rb_right;
-               else {
-                       sbi->s_es->s_last_error_block = cpu_to_le64(start_blk);
+               else
                        return 0;
-               }
        }
        return 1;
 }
@@ -220,10 +216,12 @@ static int ext4_protect_reserved_inode(struct super_block *sb,
                } else {
                        if (!ext4_data_block_valid_rcu(sbi, system_blks,
                                                map.m_pblk, n)) {
-                               ext4_error(sb, "blocks %llu-%llu from inode %u "
-                                          "overlap system zone", map.m_pblk,
-                                          map.m_pblk + map.m_len - 1, ino);
                                err = -EFSCORRUPTED;
+                               __ext4_error(sb, __func__, __LINE__, -err,
+                                            map.m_pblk, "blocks %llu-%llu "
+                                            "from inode %u overlap system zone",
+                                            map.m_pblk,
+                                            map.m_pblk + map.m_len - 1, ino);
                                break;
                        }
                        err = add_system_zone(system_blks, map.m_pblk, n);
@@ -365,7 +363,6 @@ int ext4_data_block_valid(struct ext4_sb_info *sbi, ext4_fsblk_t start_blk,
 int ext4_check_blockref(const char *function, unsigned int line,
                        struct inode *inode, __le32 *p, unsigned int max)
 {
-       struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
        __le32 *bref = p;
        unsigned int blk;
 
@@ -379,7 +376,6 @@ int ext4_check_blockref(const char *function, unsigned int line,
                if (blk &&
                    unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb),
                                                    blk, 1))) {
-                       es->s_last_error_block = cpu_to_le64(blk);
                        ext4_error_inode(inode, function, line, blk,
                                         "invalid block");
                        return -EFSCORRUPTED;