[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140709035136.GF4622@azat>
Date: Wed, 9 Jul 2014 07:51:36 +0400
From: Azat Khuzhin <a3at.mail@...il.com>
To: Andreas Dilger <adilger@...ger.ca>
Cc: linux-ext4@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH 1/3] journal: use consts instead of 1024 and add helper
for journal with 1k blocksize
On Tue, Jul 08, 2014 at 05:30:10PM -0600, Andreas Dilger wrote:
> On Jul 8, 2014, at 2:41 PM, Azat Khuzhin <a3at.mail@...il.com> wrote:
> > Use EXT2_MIN_BLOCK_SIZE/JFS_MIN_JOURNAL_BLOCKS instead of hardcoded 1024
> > when it is okay, and also add a helper ext2fs_journal_sb_start() that
> > will return start of journal sb with special case for fs with 1k block
> > size.
>
> Seems like a good idea, but an issue below.
>
> > diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
> > index 884d9c0..068eed7 100644
> > --- a/lib/ext2fs/mkjournal.c
> > +++ b/lib/ext2fs/mkjournal.c
> > @@ -75,10 +75,7 @@ errcode_t ext2fs_create_journal_superblock(ext2_filsys fs,
> > if (fs->super->s_feature_incompat &
> > EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
> > jsb->s_nr_users = 0;
> > - if (fs->blocksize == 1024)
> > - jsb->s_first = htonl(3);
> > - else
> > - jsb->s_first = htonl(2);
> > + jsb->s_first = ext2fs_journal_sb_start(fs->blocksize) + 1;
>
> This looks like it is missing the htonl() conversion, and will break the on-disk format?
Yeah, good catch, thanks!
I will resend this patch with htonl().
Cheers, Azat.
>
> The JBD code stores all data on-disk in big-endian to ensure that it is converted properly
> on the most common little-endian systems, and will therefore also work on big-endian systems.
>
> Cheers, Andreas
>
>
>
>
>
--
Respectfully
Azat Khuzhin
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists