extents.c (2ed886852adfcb070bf350e66a0da0d98b2f3ab5) extents.c (24676da469f50f433baa347845639662c561d1f6)
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 425 unchanged lines hidden (view full) ---

434 }
435 if (!ext4_valid_extent_entries(inode, eh, depth)) {
436 error_msg = "invalid extent entries";
437 goto corrupted;
438 }
439 return 0;
440
441corrupted:
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 425 unchanged lines hidden (view full) ---

434 }
435 if (!ext4_valid_extent_entries(inode, eh, depth)) {
436 error_msg = "invalid extent entries";
437 goto corrupted;
438 }
439 return 0;
440
441corrupted:
442 __ext4_error(inode->i_sb, function,
443 "bad header/extent in inode #%lu: %s - magic %x, "
442 ext4_error_inode(function, inode,
443 "bad header/extent: %s - magic %x, "
444 "entries %u, max %u(%u), depth %u(%u)",
444 "entries %u, max %u(%u), depth %u(%u)",
445 inode->i_ino, error_msg, le16_to_cpu(eh->eh_magic),
445 error_msg, le16_to_cpu(eh->eh_magic),
446 le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max),
447 max, le16_to_cpu(eh->eh_depth), depth);
448
449 return -EIO;
450}
451
452#define ext4_ext_check(inode, eh, depth) \
453 __ext4_ext_check(__func__, inode, eh, depth)

--- 1163 unchanged lines hidden (view full) ---

1617 len = (EXT_LAST_EXTENT(eh) - ex - 1)
1618 * sizeof(struct ext4_extent);
1619 memmove(ex + 1, ex + 2, len);
1620 }
1621 le16_add_cpu(&eh->eh_entries, -1);
1622 merge_done = 1;
1623 WARN_ON(eh->eh_entries == 0);
1624 if (!eh->eh_entries)
446 le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max),
447 max, le16_to_cpu(eh->eh_depth), depth);
448
449 return -EIO;
450}
451
452#define ext4_ext_check(inode, eh, depth) \
453 __ext4_ext_check(__func__, inode, eh, depth)

--- 1163 unchanged lines hidden (view full) ---

1617 len = (EXT_LAST_EXTENT(eh) - ex - 1)
1618 * sizeof(struct ext4_extent);
1619 memmove(ex + 1, ex + 2, len);
1620 }
1621 le16_add_cpu(&eh->eh_entries, -1);
1622 merge_done = 1;
1623 WARN_ON(eh->eh_entries == 0);
1624 if (!eh->eh_entries)
1625 ext4_error(inode->i_sb,
1626 "inode#%lu, eh->eh_entries = 0!",
1627 inode->i_ino);
1625 EXT4_ERROR_INODE(inode, "eh->eh_entries = 0!");
1628 }
1629
1630 return merge_done;
1631}
1632
1633/*
1634 * check if a portion of the "newext" extent overlaps with an
1635 * existing extent.

--- 2321 unchanged lines hidden ---
1626 }
1627
1628 return merge_done;
1629}
1630
1631/*
1632 * check if a portion of the "newext" extent overlaps with an
1633 * existing extent.

--- 2321 unchanged lines hidden ---