]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - repair/bmap.h
repair: refactor the BLKMAP_NEXTS_MAX check
[thirdparty/xfsprogs-dev.git] / repair / bmap.h
index 4b588df8c86fe812377f42fceafd8e2c29e18964..df9602b31e483ec48f2a38aff3ed29608349b894 100644 (file)
@@ -28,19 +28,6 @@ typedef      struct blkmap {
 #define        BLKMAP_SIZE(n)  \
        (offsetof(blkmap_t, exts) + (sizeof(bmap_ext_t) * (n)))
 
-/*
- * For 32 bit platforms, we are limited to extent arrays of 2^31 bytes, which
- * limits the number of extents in an inode we can check. If we don't limit the
- * valid range, we can overflow the BLKMAP_SIZE() calculation and allocate less
- * memory than we think we needed, and hence walk off the end of the array and
- * corrupt memory.
- */
-#if BITS_PER_LONG == 32
-#define BLKMAP_NEXTS_MAX       ((INT_MAX / sizeof(bmap_ext_t)) - 1)
-#else
-#define BLKMAP_NEXTS_MAX       INT_MAX
-#endif
-
 extern pthread_key_t dblkmap_key;
 extern pthread_key_t ablkmap_key;