Skip to contentSkip to conversation

generic/620: add '-J block64' mkfs option for ocfs2

PATCH In review Su Yue 5 participants 8 messages Jan 6, 2025 – Jan 7, 2025 OCFS2

lore
Share & tools
lore

Su Yue

author
#0 lore raw

PATCH 1/1 generic/620: add '-J block64' mkfs option for ocfs2

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
 tests/generic/620 | 3 +++
 1 file changed, 3 insertions(+)
tests/generic/620 +3 -0
index 3f1ce45a55fd..60e5a2cacdda 100755
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))
 chunk_size=128
 
 _dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2"  ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"
+
 _mkfs_dev $DMHUGEDISK_DEV
 _mount $DMHUGEDISK_DEV $SCRATCH_MNT || _fail "mount failed for $DMHUGEDISK_DEV $SCRATCH_MNT"
 testfile=$SCRATCH_MNT/testfile-$seq
Signature · 1 line
2.47.1
#1 lore raw
Quoted 2 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

Hard coding this into a specific test is weird. I would expect mkfs to pick the right one, but maybe the maintainers have a good reason for not doing that?

But if not you probably want to force it in your config file or we need a workaround in _try_mkfs_dev.

author
#2 lore raw
Quoted 12 lines · Christoph Hellwig
Quoted 2 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

Hard coding this into a specific test is weird. I would expect mkfs to pick the right one, but maybe the maintainers have a good reason for not doing that?

Sounds more reasonable. 64bit journal support of ocfs2 was added in 2008, 17 gears agao...

—
Su

Quoted 3 lines

But if not you probably want to force it in your config file or we need a workaround in _try_mkfs_dev.

#3 lore raw
In reply to Su Yue

Hi,

Quoted 13 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
 tests/generic/620 | 3 +++
 1 file changed, 3 insertions(+)
tests/generic/620 +0 -0
index 3f1ce45a55fd..60e5a2cacdda 100755

tests/generic/620 sectors=$((2*1024*1024*1024*17)) · line 45

Quoted 5 lines
tests/generic/620 +2 -0
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))
 chunk_size=128
 
 _dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2"  ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"

Makes sense, although as Christoph mentioned, a less test-specific approach might be a better. E.g. _require_scratch_16T_support could skip if block64 isn't configured, similar to ext4 (assuming tunefs.ocfs2 provides a way to query for it, which I don't see at first glance).

Cheers, David

author
#4 lore raw
Quoted 23 lines · David Disseldorp

Hi,

Quoted 15 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
tests/generic/620 | 3 +++

1 file changed, 3 insertions(+)
tests/generic/620 +0 -0
index 3f1ce45a55fd..60e5a2cacdda 100755
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))

chunk_size=128

Quoted 6 lines
Quoted 3 lines

_dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2" ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"

Makes sense, although as Christoph mentioned, a less test-specific approach might be a better. E.g. _require_scratch_16T_support could skip

My brain is clearer after one night sleep. As Christoph said, I think it’s problem of mkfs.ocfs2. Let me drop this patch. Thanks for your review.

—
Su

Quoted 4 lines

if block64 isn't configured, similar to ext4 (assuming tunefs.ocfs2 provides a way to query for it, which I don't see at first glance).

Cheers, David

#5 lore raw
In reply to Su Yue
Quoted 13 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
 tests/generic/620 | 3 +++
 1 file changed, 3 insertions(+)
tests/generic/620 +0 -0
index 3f1ce45a55fd..60e5a2cacdda 100755

tests/generic/620 sectors=$((2*1024*1024*1024*17)) · line 45

Quoted 5 lines
tests/generic/620 +2 -0
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))
 chunk_size=128
 
 _dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2"  ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"

Won't mkfs.ocfs2 turn on block64 on a > 16T volume without prompting?

--D

Quoted 8 lines
tests/generic/620 +1 -0
+
 _mkfs_dev $DMHUGEDISK_DEV
 _mount $DMHUGEDISK_DEV $SCRATCH_MNT || _fail "mount failed for $DMHUGEDISK_DEV $SCRATCH_MNT"
 testfile=$SCRATCH_MNT/testfile-$seq
Signature · 1 line
2.47.1
author
#6 lore raw
Quoted 20 lines · Darrick J. Wong
Quoted 15 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
tests/generic/620 | 3 +++

1 file changed, 3 insertions(+)
tests/generic/620 +0 -0
index 3f1ce45a55fd..60e5a2cacdda 100755
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))

chunk_size=128

Quoted 6 lines
Quoted 3 lines

_dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2" ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"

Won't mkfs.ocfs2 turn on block64 on a > 16T volume without prompting?

It won’t. Only error will be printed:

ERROR: jbd can only store block numbers in 32 bits. /dev/mapper/huge-test.620 can hold 4563402752 blocks
which overflows this limit. If you have a new enough Ocfs2 with JBD2 support, you can try formatting with the "-Jblock64" option to turn on support for this size block device.

It’s 2025 now. Maybe it’s time to make mkfs.ocfs2 turn on block64 if device size > 16T.

Maintainers may know some stories. Joseph?

—
Su

Quoted 8 lines

--D

Quoted 6 lines

+
_mkfs_dev $DMHUGEDISK_DEV
_mount $DMHUGEDISK_DEV $SCRATCH_MNT || _fail "mount failed for $DMHUGEDISK_DEV $SCRATCH_MNT" testfile=$SCRATCH_MNT/testfile-$seq

Signature · 1 line
2.47.1
maintainer
#7 lore raw
Quoted 26 lines · Glass Su
Quoted 20 lines · Darrick J. Wong
Quoted 15 lines · Su Yue

mkfs.ocfs2 is using 32bit journal as default. For 16T size device support, '-J block64' should be used.

---
tests/generic/620 | 3 +++

1 file changed, 3 insertions(+)
tests/generic/620 +0 -0
index 3f1ce45a55fd..60e5a2cacdda 100755
@@ -41,6 +41,9 @@ sectors=$((2*1024*1024*1024*17))

chunk_size=128

Quoted 6 lines
Quoted 3 lines

_dmhugedisk_init $sectors $chunk_size
+
+[ "$FSTYP" = "ocfs2" ] && MKFS_OPTIONS="$MKFS_OPTIONS -J block64"

Won't mkfs.ocfs2 turn on block64 on a > 16T volume without prompting?

Quoted 9 lines

It won’t. Only error will be printed:

ERROR: jbd can only store block numbers in 32 bits. /dev/mapper/huge-test.620 can hold 4563402752 blocks
which overflows this limit. If you have a new enough Ocfs2 with JBD2 support, you can try formatting with the "-Jblock64" option to turn on support for this size block device.

It’s 2025 now. Maybe it’s time to make mkfs.ocfs2 turn on block64 if device size > 16T.

Maintainers may know some stories. Joseph?

AFAIK, standard 32-bit journal is the default journal format for ocfs2 since the beginning.