From efc722a2198ad5f861db85ae81d55b7205b07d3d Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 6 Aug 2010 13:43:04 -0600 Subject: [PATCH] b=22906 mke2fs needs ~16TB LUNs to be 16TB-1 block Adjust LUNs at or just over 16TB to be 1 block below 16TB, to avoid problems with current (1.41) mke2fs being unhappy with this size. i=zhiqi.tao i=girish.shilamkar --- lustre/utils/mkfs_lustre.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 6f849a8..f6b0c83 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -589,8 +589,11 @@ int make_lustre_backfs(struct mkfs_opts *mop) return EINVAL; } block_count = mop->mo_device_sz / (L_BLOCK_SIZE >> 10); - /* Create one less block. Bug 22906 */ - block_count = min(block_count, 4294967295U); + /* 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) || -- 1.8.3.1