[Ocfs2-tools-devel] [PATCH 0/9] JBD2 and 64bit journals

Joel Becker joel.becker at oracle.com
Tue Sep 9 17:57:07 PDT 2008


ocfs2 currently uses the Journaled Block Device (JBD) for its
journaling.  This is a very stable and tested codebase.  However, JBD
is limited by architecture to 32bit block numbers.  This means an ocfs2
filesystem is limited to 2^32 blocks.  With a 4K blocksize, that's 16TB.
People want larger volumes.

Fortunately, there is now JBD2.  JBD2 adds 64bit block number support
and some other features.  JBD2 is backwards compatible, so it can be
used with existing filesystems.  The new features won't be accessed
until the ocfs2-tools turn them on.

Before we support JBD2, however, we need to ensure that inode blocks are
allocated below that 32bit boundary.  stat(2) cannot handle larger inode
numbers on 32bit machines.  With that limit in place, we can fully
support JBD2 in the kernel filesystem.  Like XFS, we provide the
'inode64' option to remove that limit.  

A config option is provided (CONFIG_OCFS2_COMPAT_JBD) to force ocfs2 to
use the old JBD.  This is for the paranoid while we test JBD2.

In ocfs2-tools, we have a problem.  libocfs2 was not checking journal
feature bits, so it will load journals it does not understand and do
crazy things.  To fix this, we introduce the
OCFS2_FEATURE_COMPAT_JBD2_SB.  Only filesystems with this feature bit
can have extended journal features.  It is a COMPAT feature because JBD
and JBD2 have always checked the journal features.  It's safe for older
ocfs2 drivers to mount the filesystem as long as the journal driver
can handle the journal features.

Before we can turn on OCFS2_FEATURE_COMPAT_JBD2_SB, we do the following:

- libocfs2 checks journal feature bits, then gains the ability to
  set and clear them.
- fsck.ocfs2 learns to recover 64bit journals and feature bits
- tunefs.ocfs2 checks journal features and copies them to any new
  journals it creates.

Once that's done, we can put the OCFS2_FEATURE_COMPAT_JBD2_SB feature on
filesystems, then allow tools to support JBD2_FEATURE_INCOMPAT_64BIT.
Finally, mkfs.ocfs2 learns to create 64bit journals with -Jblock64.


The kernel code is available on the 'jbd2' branch of my git repository.

View:
http://oss.oracle.com/git/?p=jlbec/linux-2.6.git;a=shortlog;h=jbd2
Pull:
git pull git://oss.oracle.com/git/jlbec/linux-2.6.git jbd2

The tools code is available on the 'jbd2' branch of the ocfs2-tools git
repository.

View:
http://oss.oracle.com/git/?p=ocfs2-tools.git;a=shortlog;h=jbd2
Pull:
git pull git://oss.oracle.com/git/ocfs2-tools.git jbd2





More information about the Ocfs2-tools-devel mailing list