summaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2015-10-17 16:16:04 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-10-17 16:16:04 -0400
commit6a797d2737838906f2ea0a31686e87c3151e21ca (patch)
treec13f506c771271660fb76d3e0ba86a9e107f0ed9 /fs/ext4/extents.c
parent8c81bd8f586c46eaf114758a78d82895a2b081c2 (diff)
ext4: call out CRC and corruption errors with specific error codes
Instead of overloading EIO for CRC errors and corrupt structures, return the same error codes that XFS returns for the same issues. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 7f486e350d15..faeaba8582d7 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -442,7 +442,7 @@ static int __ext4_ext_check(const char *function, unsigned int line,
442 int depth, ext4_fsblk_t pblk) 442 int depth, ext4_fsblk_t pblk)
443{ 443{
444 const char *error_msg; 444 const char *error_msg;
445 int max = 0; 445 int max = 0, err = -EFSCORRUPTED;
446 446
447 if (unlikely(eh->eh_magic != EXT4_EXT_MAGIC)) { 447 if (unlikely(eh->eh_magic != EXT4_EXT_MAGIC)) {
448 error_msg = "invalid magic"; 448 error_msg = "invalid magic";
@@ -473,6 +473,7 @@ static int __ext4_ext_check(const char *function, unsigned int line,
473 if (ext_depth(inode) != depth && 473 if (ext_depth(inode) != depth &&
474 !ext4_extent_block_csum_verify(inode, eh)) { 474 !ext4_extent_block_csum_verify(inode, eh)) {
475 error_msg = "extent tree corrupted"; 475 error_msg = "extent tree corrupted";
476 err = -EFSBADCRC;
476 goto corrupted; 477 goto corrupted;
477 } 478 }
478 return 0; 479 return 0;
@@ -485,7 +486,7 @@ corrupted:
485 le16_to_cpu(eh->eh_magic), 486 le16_to_cpu(eh->eh_magic),
486 le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max), 487 le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max),
487 max, le16_to_cpu(eh->eh_depth), depth); 488 max, le16_to_cpu(eh->eh_depth), depth);
488 return -EIO; 489 return err;
489} 490}
490 491
491#define ext4_ext_check(inode, eh, depth, pblk) \ 492#define ext4_ext_check(inode, eh, depth, pblk) \
@@ -910,7 +911,7 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
910 put_bh(bh); 911 put_bh(bh);
911 EXT4_ERROR_INODE(inode, 912 EXT4_ERROR_INODE(inode,
912 "ppos %d > depth %d", ppos, depth); 913 "ppos %d > depth %d", ppos, depth);
913 ret = -EIO; 914 ret = -EFSCORRUPTED;
914 goto err; 915 goto err;
915 } 916 }
916 path[ppos].p_bh = bh; 917 path[ppos].p_bh = bh;
@@ -959,7 +960,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
959 EXT4_ERROR_INODE(inode, 960 EXT4_ERROR_INODE(inode,
960 "logical %d == ei_block %d!", 961 "logical %d == ei_block %d!",
961 logical, le32_to_cpu(curp->p_idx->ei_block)); 962 logical, le32_to_cpu(curp->p_idx->ei_block));
962 return -EIO; 963 return -EFSCORRUPTED;
963 } 964 }
964 965
965 if (unlikely(le16_to_cpu(curp->p_hdr->eh_entries) 966 if (unlikely(le16_to_cpu(curp->p_hdr->eh_entries)
@@ -968,7 +969,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
968 "eh_entries %d >= eh_max %d!", 969 "eh_entries %d >= eh_max %d!",
969 le16_to_cpu(curp->p_hdr->eh_entries), 970 le16_to_cpu(curp->p_hdr->eh_entries),
970 le16_to_cpu(curp->p_hdr->eh_max)); 971 le16_to_cpu(curp->p_hdr->eh_max));
971 return -EIO; 972 return -EFSCORRUPTED;
972 } 973 }
973 974
974 if (logical > le32_to_cpu(curp->p_idx->ei_block)) { 975 if (logical > le32_to_cpu(curp->p_idx->ei_block)) {
@@ -992,7 +993,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
992 993
993 if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) { 994 if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) {
994 EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!"); 995 EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!");
995 return -EIO; 996 return -EFSCORRUPTED;
996 } 997 }
997 998
998 ix->ei_block = cpu_to_le32(logical); 999 ix->ei_block = cpu_to_le32(logical);
@@ -1001,7 +1002,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
1001 1002
1002 if (unlikely(ix > EXT_LAST_INDEX(curp->p_hdr))) { 1003 if (unlikely(ix > EXT_LAST_INDEX(curp->p_hdr))) {
1003 EXT4_ERROR_INODE(inode, "ix > EXT_LAST_INDEX!"); 1004 EXT4_ERROR_INODE(inode, "ix > EXT_LAST_INDEX!");
1004 return -EIO; 1005 return -EFSCORRUPTED;
1005 } 1006 }
1006 1007
1007 err = ext4_ext_dirty(handle, inode, curp); 1008 err = ext4_ext_dirty(handle, inode, curp);
@@ -1042,7 +1043,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1042 * border from split point */ 1043 * border from split point */
1043 if (unlikely(path[depth].p_ext > EXT_MAX_EXTENT(path[depth].p_hdr))) { 1044 if (unlikely(path[depth].p_ext > EXT_MAX_EXTENT(path[depth].p_hdr))) {
1044 EXT4_ERROR_INODE(inode, "p_ext > EXT_MAX_EXTENT!"); 1045 EXT4_ERROR_INODE(inode, "p_ext > EXT_MAX_EXTENT!");
1045 return -EIO; 1046 return -EFSCORRUPTED;
1046 } 1047 }
1047 if (path[depth].p_ext != EXT_MAX_EXTENT(path[depth].p_hdr)) { 1048 if (path[depth].p_ext != EXT_MAX_EXTENT(path[depth].p_hdr)) {
1048 border = path[depth].p_ext[1].ee_block; 1049 border = path[depth].p_ext[1].ee_block;
@@ -1086,7 +1087,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1086 newblock = ablocks[--a]; 1087 newblock = ablocks[--a];
1087 if (unlikely(newblock == 0)) { 1088 if (unlikely(newblock == 0)) {
1088 EXT4_ERROR_INODE(inode, "newblock == 0!"); 1089 EXT4_ERROR_INODE(inode, "newblock == 0!");
1089 err = -EIO; 1090 err = -EFSCORRUPTED;
1090 goto cleanup; 1091 goto cleanup;
1091 } 1092 }
1092 bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS); 1093 bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS);
@@ -1112,7 +1113,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1112 EXT4_ERROR_INODE(inode, "eh_entries %d != eh_max %d!", 1113 EXT4_ERROR_INODE(inode, "eh_entries %d != eh_max %d!",
1113 path[depth].p_hdr->eh_entries, 1114 path[depth].p_hdr->eh_entries,
1114 path[depth].p_hdr->eh_max); 1115 path[depth].p_hdr->eh_max);
1115 err = -EIO; 1116 err = -EFSCORRUPTED;
1116 goto cleanup; 1117 goto cleanup;
1117 } 1118 }
1118 /* start copy from next extent */ 1119 /* start copy from next extent */
@@ -1151,7 +1152,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1151 k = depth - at - 1; 1152 k = depth - at - 1;
1152 if (unlikely(k < 0)) { 1153 if (unlikely(k < 0)) {
1153 EXT4_ERROR_INODE(inode, "k %d < 0!", k); 1154 EXT4_ERROR_INODE(inode, "k %d < 0!", k);
1154 err = -EIO; 1155 err = -EFSCORRUPTED;
1155 goto cleanup; 1156 goto cleanup;
1156 } 1157 }
1157 if (k) 1158 if (k)
@@ -1191,7 +1192,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1191 EXT4_ERROR_INODE(inode, 1192 EXT4_ERROR_INODE(inode,
1192 "EXT_MAX_INDEX != EXT_LAST_INDEX ee_block %d!", 1193 "EXT_MAX_INDEX != EXT_LAST_INDEX ee_block %d!",
1193 le32_to_cpu(path[i].p_ext->ee_block)); 1194 le32_to_cpu(path[i].p_ext->ee_block));
1194 err = -EIO; 1195 err = -EFSCORRUPTED;
1195 goto cleanup; 1196 goto cleanup;
1196 } 1197 }
1197 /* start copy indexes */ 1198 /* start copy indexes */
@@ -1425,7 +1426,7 @@ static int ext4_ext_search_left(struct inode *inode,
1425 1426
1426 if (unlikely(path == NULL)) { 1427 if (unlikely(path == NULL)) {
1427 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); 1428 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical);
1428 return -EIO; 1429 return -EFSCORRUPTED;
1429 } 1430 }
1430 depth = path->p_depth; 1431 depth = path->p_depth;
1431 *phys = 0; 1432 *phys = 0;
@@ -1444,7 +1445,7 @@ static int ext4_ext_search_left(struct inode *inode,
1444 EXT4_ERROR_INODE(inode, 1445 EXT4_ERROR_INODE(inode,
1445 "EXT_FIRST_EXTENT != ex *logical %d ee_block %d!", 1446 "EXT_FIRST_EXTENT != ex *logical %d ee_block %d!",
1446 *logical, le32_to_cpu(ex->ee_block)); 1447 *logical, le32_to_cpu(ex->ee_block));
1447 return -EIO; 1448 return -EFSCORRUPTED;
1448 } 1449 }
1449 while (--depth >= 0) { 1450 while (--depth >= 0) {
1450 ix = path[depth].p_idx; 1451 ix = path[depth].p_idx;
@@ -1455,7 +1456,7 @@ static int ext4_ext_search_left(struct inode *inode,
1455 EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ? 1456 EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ?
1456 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0, 1457 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0,
1457 depth); 1458 depth);
1458 return -EIO; 1459 return -EFSCORRUPTED;
1459 } 1460 }
1460 } 1461 }
1461 return 0; 1462 return 0;
@@ -1465,7 +1466,7 @@ static int ext4_ext_search_left(struct inode *inode,
1465 EXT4_ERROR_INODE(inode, 1466 EXT4_ERROR_INODE(inode,
1466 "logical %d < ee_block %d + ee_len %d!", 1467 "logical %d < ee_block %d + ee_len %d!",
1467 *logical, le32_to_cpu(ex->ee_block), ee_len); 1468 *logical, le32_to_cpu(ex->ee_block), ee_len);
1468 return -EIO; 1469 return -EFSCORRUPTED;
1469 } 1470 }
1470 1471
1471 *logical = le32_to_cpu(ex->ee_block) + ee_len - 1; 1472 *logical = le32_to_cpu(ex->ee_block) + ee_len - 1;
@@ -1495,7 +1496,7 @@ static int ext4_ext_search_right(struct inode *inode,
1495 1496
1496 if (unlikely(path == NULL)) { 1497 if (unlikely(path == NULL)) {
1497 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); 1498 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical);
1498 return -EIO; 1499 return -EFSCORRUPTED;
1499 } 1500 }
1500 depth = path->p_depth; 1501 depth = path->p_depth;
1501 *phys = 0; 1502 *phys = 0;
@@ -1514,7 +1515,7 @@ static int ext4_ext_search_right(struct inode *inode,
1514 EXT4_ERROR_INODE(inode, 1515 EXT4_ERROR_INODE(inode,
1515 "first_extent(path[%d].p_hdr) != ex", 1516 "first_extent(path[%d].p_hdr) != ex",
1516 depth); 1517 depth);
1517 return -EIO; 1518 return -EFSCORRUPTED;
1518 } 1519 }
1519 while (--depth >= 0) { 1520 while (--depth >= 0) {
1520 ix = path[depth].p_idx; 1521 ix = path[depth].p_idx;
@@ -1522,7 +1523,7 @@ static int ext4_ext_search_right(struct inode *inode,
1522 EXT4_ERROR_INODE(inode, 1523 EXT4_ERROR_INODE(inode,
1523 "ix != EXT_FIRST_INDEX *logical %d!", 1524 "ix != EXT_FIRST_INDEX *logical %d!",
1524 *logical); 1525 *logical);
1525 return -EIO; 1526 return -EFSCORRUPTED;
1526 } 1527 }
1527 } 1528 }
1528 goto found_extent; 1529 goto found_extent;
@@ -1532,7 +1533,7 @@ static int ext4_ext_search_right(struct inode *inode,
1532 EXT4_ERROR_INODE(inode, 1533 EXT4_ERROR_INODE(inode,
1533 "logical %d < ee_block %d + ee_len %d!", 1534 "logical %d < ee_block %d + ee_len %d!",
1534 *logical, le32_to_cpu(ex->ee_block), ee_len); 1535 *logical, le32_to_cpu(ex->ee_block), ee_len);
1535 return -EIO; 1536 return -EFSCORRUPTED;
1536 } 1537 }
1537 1538
1538 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) { 1539 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) {
@@ -1670,7 +1671,7 @@ static int ext4_ext_correct_indexes(handle_t *handle, struct inode *inode,
1670 if (unlikely(ex == NULL || eh == NULL)) { 1671 if (unlikely(ex == NULL || eh == NULL)) {
1671 EXT4_ERROR_INODE(inode, 1672 EXT4_ERROR_INODE(inode,
1672 "ex %p == NULL or eh %p == NULL", ex, eh); 1673 "ex %p == NULL or eh %p == NULL", ex, eh);
1673 return -EIO; 1674 return -EFSCORRUPTED;
1674 } 1675 }
1675 1676
1676 if (depth == 0) { 1677 if (depth == 0) {
@@ -1938,14 +1939,14 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
1938 mb_flags |= EXT4_MB_DELALLOC_RESERVED; 1939 mb_flags |= EXT4_MB_DELALLOC_RESERVED;
1939 if (unlikely(ext4_ext_get_actual_len(newext) == 0)) { 1940 if (unlikely(ext4_ext_get_actual_len(newext) == 0)) {
1940 EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0"); 1941 EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0");
1941 return -EIO; 1942 return -EFSCORRUPTED;
1942 } 1943 }
1943 depth = ext_depth(inode); 1944 depth = ext_depth(inode);
1944 ex = path[depth].p_ext; 1945 ex = path[depth].p_ext;
1945 eh = path[depth].p_hdr; 1946 eh = path[depth].p_hdr;
1946 if (unlikely(path[depth].p_hdr == NULL)) { 1947 if (unlikely(path[depth].p_hdr == NULL)) {
1947 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); 1948 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth);
1948 return -EIO; 1949 return -EFSCORRUPTED;
1949 } 1950 }
1950 1951
1951 /* try to insert block into found extent and return */ 1952 /* try to insert block into found extent and return */
@@ -2172,7 +2173,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2172 if (unlikely(path[depth].p_hdr == NULL)) { 2173 if (unlikely(path[depth].p_hdr == NULL)) {
2173 up_read(&EXT4_I(inode)->i_data_sem); 2174 up_read(&EXT4_I(inode)->i_data_sem);
2174 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); 2175 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth);
2175 err = -EIO; 2176 err = -EFSCORRUPTED;
2176 break; 2177 break;
2177 } 2178 }
2178 ex = path[depth].p_ext; 2179 ex = path[depth].p_ext;
@@ -2241,7 +2242,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2241 2242
2242 if (unlikely(es.es_len == 0)) { 2243 if (unlikely(es.es_len == 0)) {
2243 EXT4_ERROR_INODE(inode, "es.es_len == 0"); 2244 EXT4_ERROR_INODE(inode, "es.es_len == 0");
2244 err = -EIO; 2245 err = -EFSCORRUPTED;
2245 break; 2246 break;
2246 } 2247 }
2247 2248
@@ -2264,7 +2265,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
2264 "next extent == %u, next " 2265 "next extent == %u, next "
2265 "delalloc extent = %u", 2266 "delalloc extent = %u",
2266 next, next_del); 2267 next, next_del);
2267 err = -EIO; 2268 err = -EFSCORRUPTED;
2268 break; 2269 break;
2269 } 2270 }
2270 } 2271 }
@@ -2363,7 +2364,7 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
2363 leaf = ext4_idx_pblock(path->p_idx); 2364 leaf = ext4_idx_pblock(path->p_idx);
2364 if (unlikely(path->p_hdr->eh_entries == 0)) { 2365 if (unlikely(path->p_hdr->eh_entries == 0)) {
2365 EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0"); 2366 EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0");
2366 return -EIO; 2367 return -EFSCORRUPTED;
2367 } 2368 }
2368 err = ext4_ext_get_access(handle, inode, path); 2369 err = ext4_ext_get_access(handle, inode, path);
2369 if (err) 2370 if (err)
@@ -2612,7 +2613,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
2612 eh = path[depth].p_hdr; 2613 eh = path[depth].p_hdr;
2613 if (unlikely(path[depth].p_hdr == NULL)) { 2614 if (unlikely(path[depth].p_hdr == NULL)) {
2614 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); 2615 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth);
2615 return -EIO; 2616 return -EFSCORRUPTED;
2616 } 2617 }
2617 /* find where to start removing */ 2618 /* find where to start removing */
2618 ex = path[depth].p_ext; 2619 ex = path[depth].p_ext;
@@ -2666,7 +2667,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
2666 "on extent %u:%u", 2667 "on extent %u:%u",
2667 start, end, ex_ee_block, 2668 start, end, ex_ee_block,
2668 ex_ee_block + ex_ee_len - 1); 2669 ex_ee_block + ex_ee_len - 1);
2669 err = -EIO; 2670 err = -EFSCORRUPTED;
2670 goto out; 2671 goto out;
2671 } else if (a != ex_ee_block) { 2672 } else if (a != ex_ee_block) {
2672 /* remove tail of the extent */ 2673 /* remove tail of the extent */
@@ -2841,7 +2842,7 @@ again:
2841 EXT4_ERROR_INODE(inode, 2842 EXT4_ERROR_INODE(inode,
2842 "path[%d].p_hdr == NULL", 2843 "path[%d].p_hdr == NULL",
2843 depth); 2844 depth);
2844 err = -EIO; 2845 err = -EFSCORRUPTED;
2845 } 2846 }
2846 goto out; 2847 goto out;
2847 } 2848 }
@@ -2920,7 +2921,7 @@ again:
2920 i = 0; 2921 i = 0;
2921 2922
2922 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) { 2923 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) {
2923 err = -EIO; 2924 err = -EFSCORRUPTED;
2924 goto out; 2925 goto out;
2925 } 2926 }
2926 } 2927 }
@@ -2978,7 +2979,7 @@ again:
2978 * Should be a no-op if we did IO above. */ 2979 * Should be a no-op if we did IO above. */
2979 cond_resched(); 2980 cond_resched();
2980 if (WARN_ON(i + 1 > depth)) { 2981 if (WARN_ON(i + 1 > depth)) {
2981 err = -EIO; 2982 err = -EFSCORRUPTED;
2982 break; 2983 break;
2983 } 2984 }
2984 path[i + 1].p_bh = bh; 2985 path[i + 1].p_bh = bh;
@@ -3345,7 +3346,7 @@ static int ext4_split_extent(handle_t *handle,
3345 if (!ex) { 3346 if (!ex) {
3346 EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 3347 EXT4_ERROR_INODE(inode, "unexpected hole at %lu",
3347 (unsigned long) map->m_lblk); 3348 (unsigned long) map->m_lblk);
3348 return -EIO; 3349 return -EFSCORRUPTED;
3349 } 3350 }
3350 unwritten = ext4_ext_is_unwritten(ex); 3351 unwritten = ext4_ext_is_unwritten(ex);
3351 split_flag1 = 0; 3352 split_flag1 = 0;
@@ -3973,7 +3974,7 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
3973 if (!ex) { 3974 if (!ex) {
3974 EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 3975 EXT4_ERROR_INODE(inode, "unexpected hole at %lu",
3975 (unsigned long) map->m_lblk); 3976 (unsigned long) map->m_lblk);
3976 return -EIO; 3977 return -EFSCORRUPTED;
3977 } 3978 }
3978 } 3979 }
3979 3980
@@ -4311,7 +4312,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
4311 "lblock: %lu, depth: %d pblock %lld", 4312 "lblock: %lu, depth: %d pblock %lld",
4312 (unsigned long) map->m_lblk, depth, 4313 (unsigned long) map->m_lblk, depth,
4313 path[depth].p_block); 4314 path[depth].p_block);
4314 err = -EIO; 4315 err = -EFSCORRUPTED;
4315 goto out2; 4316 goto out2;
4316 } 4317 }
4317 4318
@@ -5274,7 +5275,7 @@ ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift,
5274 if (depth == path->p_depth) { 5275 if (depth == path->p_depth) {
5275 ex_start = path[depth].p_ext; 5276 ex_start = path[depth].p_ext;
5276 if (!ex_start) 5277 if (!ex_start)
5277 return -EIO; 5278 return -EFSCORRUPTED;
5278 5279
5279 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr); 5280 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr);
5280 5281
@@ -5414,7 +5415,7 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
5414 if (!extent) { 5415 if (!extent) {
5415 EXT4_ERROR_INODE(inode, "unexpected hole at %lu", 5416 EXT4_ERROR_INODE(inode, "unexpected hole at %lu",
5416 (unsigned long) *iterator); 5417 (unsigned long) *iterator);
5417 return -EIO; 5418 return -EFSCORRUPTED;
5418 } 5419 }
5419 if (SHIFT == SHIFT_LEFT && *iterator > 5420 if (SHIFT == SHIFT_LEFT && *iterator >
5420 le32_to_cpu(extent->ee_block)) { 5421 le32_to_cpu(extent->ee_block)) {