[Ocfs2-tools-devel] [PATCH 3/3] mkfs.ocfs2: Add 64bit journal support.

Mark Fasheh mfasheh at suse.com
Sun Sep 7 13:53:02 PDT 2008


On Fri, Sep 05, 2008 at 11:36:42PM -0700, Joel Becker wrote:
> The [no]block32 and [no]block64 journal options are added to mkfs -J.
> noblock32 and block64 will create 64bit-capable journals.

Obviously, this patch will have to be updated with any incompat bit we add
to the scheme.

> +/* Returns true if we support these journal features */
> +static int ocfs2_journal_check_available_features(journal_superblock_t *jsb,
> +						  ocfs2_fs_options *features)
> +{
> +	if (!features->opt_compat && !features->opt_ro_compat &&
> +	    !features->opt_incompat)
> +		return 1;
> +
> +	if (jsb->s_header.h_blocktype != JBD2_SUPERBLOCK_V2)
> +		return 0;

Ahh, this is clearly JFS_SUPERBLOCK_V2 renamed for JBD2.

So - I take it we've never written a V1 superblock on an Ocfs2 volume before?


> diff --git a/mkfs.ocfs2/mkfs.h b/mkfs.ocfs2/mkfs.h
> index b98b705..bd8ac45 100644
> --- a/mkfs.ocfs2/mkfs.h
> +++ b/mkfs.ocfs2/mkfs.h
> @@ -212,6 +212,7 @@ struct _State {
>  	unsigned int initial_slots;
>  
>  	uint64_t journal_size_in_bytes;
> +	int journal64;
>  
>  	char *vol_label;
>  	char *device_name;

Don't we need to update check_32bit_blocks()? The function altogether should be skipped
if we have 64 bit blocks turned on. Also, in case we need to check, and the
check fails, we can try updating the error text:


	fprintf(stderr, "ERROR: jbd can only store block numbers in 32 bits. "
		"%s can hold %"PRIu64" 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.\n"
		"Otherwise, consider increasing the block size or decreasing the device "
		"size.\n", s->device_name, s->volume_size_in_blocks);


Also, you might want to stick the new options in the man page.
	--Mark

--
Mark Fasheh



More information about the Ocfs2-tools-devel mailing list