[Ocfs2-tools-devel] [PATCH 6/9] mkfs.ocfs2: Add FEATURE_COMPAT_JBD2_SB.

Joel Becker Joel.Becker at oracle.com
Tue Sep 9 18:34:05 PDT 2008


On Tue, Sep 09, 2008 at 05:57:13PM -0700, Joel Becker wrote:
> All filesystems that support FEATURE_COMPAT_JBD2_SB can handle journal
> superblock features.  We use this feature to prevent older fsck/tunefs
> from loading journal features they don't understand (since they never
> checked).  The code at this point will check for unknown features, and
> it doesn't know any.  Thus it can safely fsck/tune JBD2_SB filesystems
> it creates.

	Turns out there is a bug in mkfs.ocfs2 - it doesn't handle
compat features right.  Here's the fix, which I'll put at the front of
the series:

mkfs.ocfs2: Fix a bug in COMPAT_BACKUP_SUPER handling.

The backup superblock handling tried to clear the backup super bit with

    opt_compat &= !OCFS2_FEATURE_COMPAT_BACKUP_SUPER

However, ! is not the same as ~.  Fix it.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 mkfs.ocfs2/mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
index ad1da36..ac09c70 100644
--- a/mkfs.ocfs2/mkfs.c
+++ b/mkfs.ocfs2/mkfs.c
@@ -1931,7 +1931,7 @@ format_superblock(State *s, SystemFileDiskRecord *rec,
 	 * "s->no_backup_super" according to the features in get_state,
 	 * so it is safe to clear the flag here.
 	 */
-	s->feature_flags.opt_compat &= !OCFS2_FEATURE_COMPAT_BACKUP_SB;
+	s->feature_flags.opt_compat &= ~OCFS2_FEATURE_COMPAT_BACKUP_SB;
 
 	di->id2.i_super.s_feature_incompat = s->feature_flags.opt_incompat;
 	di->id2.i_super.s_feature_compat = s->feature_flags.opt_compat;
-- 
1.5.6.3


-- 

Life's Little Instruction Book #222

	"Think twice before burdening a friend with a secret."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list