Whamcloud - gitweb
b=22906 fix invalid block count with 16TB block device
authorZhiqi Tao <zhiqi.tao@oracle.com>
Fri, 18 Jun 2010 21:09:09 +0000 (23:09 +0200)
committerJohann Lombardi <johann@sun.com>
Fri, 18 Jun 2010 21:09:09 +0000 (23:09 +0200)
lustre/utils/mkfs_lustre.c

index c29661c..bb37304 100644 (file)
@@ -88,6 +88,7 @@
 #define INDEX_UNASSIGNED 0xFFFF
 #define MO_IS_LOOP     0x01
 #define MO_FORCEFORMAT 0x02
+#define min(x,y) ((x)<(y) ? (x) : (y))
 
 /* used to describe the options to format the lustre disk, not persistent */
 struct mkfs_opts {
@@ -588,6 +589,8 @@ 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, 4294967295);
         }
 
         if ((mop->mo_ldd.ldd_mount_type == LDD_MT_EXT3) ||