Whamcloud - gitweb
b=22906 limit filesystem size for LUN size close to 16TB
[fs/lustre-release.git] / lustre / utils / mkfs_lustre.c
index 28c3806..bcdfc29 100644 (file)
@@ -587,6 +587,11 @@ int make_lustre_backfs(struct mkfs_opts *mop)
                         return EINVAL;
                 }
                 block_count = mop->mo_device_sz / (L_BLOCK_SIZE >> 10);
+                /* If the LUN size is just over 2^32 blocks, limit the
+                 * filesystem size to 2^32-1 blocks to avoid problems with
+                 * ldiskfs/mkfs not handling this size.  Bug 22906 */
+                if (block_count > 0xffffffffULL && block_count < 0x100002000ULL)
+                        block_count = 0xffffffffULL;
         }
 
         if ((mop->mo_ldd.ldd_mount_type == LDD_MT_EXT3) ||