Use EXT_UNSET_BLOCK to avoid confusion with EXT_MAX_BLOCK on 16TB-1 block
filesystems.
This patch was committed to b_release_1_8_0, but was missed on ldiskfs HEAD
for b1_8.
b=16114
o=girish.shilamkar
i=adilger
i=kalpak.shah
-+ * returns first allocated block from next leaf or EXT_MAX_BLOCK
++ * returns first allocated block from next leaf or EXT_UNSET_BLOCK
+ */
+static unsigned ext3_ext_next_leaf_block(struct inode *inode,
+ struct ext3_ext_path *path)
+ */
+static unsigned ext3_ext_next_leaf_block(struct inode *inode,
+ struct ext3_ext_path *path)
+
+ /* zero-tree has no leaf blocks at all */
+ if (depth == 0)
+
+ /* zero-tree has no leaf blocks at all */
+ if (depth == 0)
++ return EXT_UNSET_BLOCK;
+
+ /* go to index block */
+ depth--;
+
+ /* go to index block */
+ depth--;
++ return EXT_UNSET_BLOCK;
+ fex = EXT_LAST_EXTENT(eh);
+ next = ext3_ext_next_leaf_block(inode, path);
+ if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block)
+ fex = EXT_LAST_EXTENT(eh);
+ next = ext3_ext_next_leaf_block(inode, path);
+ if (le32_to_cpu(newext->ee_block) > le32_to_cpu(fex->ee_block)
-+ && next != EXT_MAX_BLOCK) {
++ && next != EXT_UNSET_BLOCK) {
+ ext_debug(inode, "next leaf block - %d\n", next);
+ BUG_ON(npath != NULL);
+ npath = ext3_ext_find_extent(inode, next, NULL);
+ ext_debug(inode, "next leaf block - %d\n", next);
+ BUG_ON(npath != NULL);
+ npath = ext3_ext_find_extent(inode, next, NULL);
+ path[depth].p_ext = ex;
+
+ a = ex_ee_block > start ? ex_ee_block : start;
+ path[depth].p_ext = ex;
+
+ a = ex_ee_block > start ? ex_ee_block : start;
-+ b = ex_ee_block + ex_ee_len - 1 < EXT_MAX_BLOCK ?
-+ ex_ee_block + ex_ee_len - 1 : EXT_MAX_BLOCK;
++ b = (unsigned long long)ex_ee_block + ex_ee_len - 1 <
++ EXT_MAX_BLOCK ? ex_ee_block + ex_ee_len - 1 : EXT_MAX_BLOCK;
+
+ ext_debug(inode, " border %u:%u\n", a, b);
+
+
+ ext_debug(inode, " border %u:%u\n", a, b);
+
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.18.8/include/linux/ext3_extents.h 2007-07-17 09:18:14.000000000 +0200
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.18.8/include/linux/ext3_extents.h 2007-07-17 09:18:14.000000000 +0200
+/*
+ * Copyright 2008 Sun Microsystems, Inc.
+ * Written by Alex Tomas <alex@clusterfs.com>
+/*
+ * Copyright 2008 Sun Microsystems, Inc.
+ * Written by Alex Tomas <alex@clusterfs.com>
+
+
+#define EXT_MAX_BLOCK 0xffffffff
+
+
+#define EXT_MAX_BLOCK 0xffffffff
++#define EXT_UNSET_BLOCK 1
+
+#define EXT_FLAGS_CLR_UNKNOWN 0x7 /* Flags cleared on modification */
+#define EXT_HDR_GEN_BITS 24
+
+#define EXT_FLAGS_CLR_UNKNOWN 0x7 /* Flags cleared on modification */
+#define EXT_HDR_GEN_BITS 24