f2fs: use generic EFSBADCRC/EFSCORRUPTED
[platform/kernel/linux-rpi.git] / fs / f2fs / segment.c
index da7af78..10d5dcd 100644 (file)
@@ -2657,7 +2657,7 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
        if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
                f2fs_msg(sbi->sb, KERN_WARNING,
                        "Found FS corruption, run fsck to fix.");
-               return -EIO;
+               return -EFSCORRUPTED;
        }
 
        /* start/end segment number in main_area */
@@ -3079,7 +3079,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
 
        if (!IS_DATASEG(get_seg_entry(sbi, segno)->type)) {
                set_sbi_flag(sbi, SBI_NEED_FSCK);
-               return -EFAULT;
+               return -EFSCORRUPTED;
        }
 
        stat_inc_inplace_blocks(fio->sbi);
@@ -3966,7 +3966,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
                                        "Wrong journal entry on segno %u",
                                        start);
                        set_sbi_flag(sbi, SBI_NEED_FSCK);
-                       err = -EINVAL;
+                       err = -EFSCORRUPTED;
                        break;
                }
 
@@ -4007,7 +4007,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
                        "SIT is corrupted node# %u vs %u",
                        total_node_blocks, valid_node_count(sbi));
                set_sbi_flag(sbi, SBI_NEED_FSCK);
-               err = -EINVAL;
+               err = -EFSCORRUPTED;
        }
 
        return err;
@@ -4127,7 +4127,7 @@ out:
                                "segno:%u, type:%u, next_blkoff:%u, blkofs:%u",
                                i, curseg->segno, curseg->alloc_type,
                                curseg->next_blkoff, blkofs);
-                       return -EINVAL;
+                       return -EFSCORRUPTED;
                }
        }
        return 0;