[Ocfs2-tools-devel] ocfs2-tools-64bitblocks.patch for ocfs2-tools-1.3.9-0.1

Sabuj Pattanayek sabujp at gmail.com
Thu Jul 17 02:13:52 PDT 2008


Hi,

Here's a patch to allow mkfs.ocfs2 to create volumes greater than 16T.
Haven't tested tunefs.ocfs2 yet:

--- ./tunefs.ocfs2/resize.c.old	2008-07-17 02:24:22.000000000 -0500
+++ ./tunefs.ocfs2/resize.c	2008-07-17 02:24:59.000000000 -0500
@@ -140,10 +140,10 @@
 		return -1;
 	}

-	if (opts.num_blocks > UINT32_MAX) {
-		com_err(opts.progname, 0, "As JBD can only store block numbers "
-			"in 32 bits, %s cannot be grown to more than %"PRIu64" "
-			"blocks.", opts.device, UINT32_MAX);
+	if (opts.num_blocks > UINT64_MAX) {
+		com_err(opts.progname, 0, "As JBD2 can only store block numbers "
+			"in 64 bits, %s cannot be grown to more than %"PRIu64" "
+			"blocks.", opts.device, UINT64_MAX);
 		return -1;
 	}

--- ./mkfs.ocfs2/mkfs.c.old	2008-07-17 02:21:25.000000000 -0500
+++ ./mkfs.ocfs2/mkfs.c	2008-07-17 02:22:44.000000000 -0500
@@ -247,7 +247,7 @@

 	print_state (s);

-	check_32bit_blocks (s);
+	/*check_32bit_blocks (s);*/

 	init_record(s, &superblock_rec, SFI_OTHER, S_IFREG | 0644);
 	init_record(s, &root_dir_rec, SFI_OTHER, S_IFDIR | 0755);

Here's some testing output:

porpoise ~ # uname -a
Linux porpoise 2.6.26 #1 Thu Jul 17 02:11:23 CDT 2008 ppc64 PPC970FX,
altivec supported RackMac3,1 GNU/Linux

porpoise ~ # mkfs.ocfs2 -F -v -b 4096 -T mail /dev/vg/20T
mkfs.ocfs2 1.3.9
Overwriting existing ocfs2 partition.
WARNING: Cluster check disabled.
Proceed (y/N): y
Filesystem Type of mail
Filesystem label=
Block size=4096 (bits=12)
Cluster size=8192 (bits=13)
Volume size=20993800142848 (2562719744 clusters) (5125439488 blocks)
79450 cluster groups (tail covers 12800 clusters, rest cover 32256 clusters)
Journal size=268435456
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 6 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful


porpoise ~ # o2cb_ctl -H -n test -t cluster -a online=yes
Cluster test created
Node porpoise added
porpoise ~ # mount /dev/vg/20T /mnt/ocfs2

messages:

Jul 17 03:55:28 porpoise ocfs2: Mounting device (252,4) on (node 1,
slot 0) with ordered data mode.

porpoise ~ # df -h /mnt/ocfs2
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg-20T     20T  1.7G   20T   1% /mnt/ocfs2

Eventually I'll try to create really large files and fill the volume beyond 16T.

Cheers,
Sabuj Pattanayek



More information about the Ocfs2-tools-devel mailing list