From: Azat Khuzhin <a3at.mail@gmail.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH 1/3] journal: use consts instead of 1024 and add helper for journal with 1k blocksize
Date: Wed, 9 Jul 2014 07:51:36 +0400 [thread overview]
Message-ID: <20140709035136.GF4622@azat> (raw)
In-Reply-To: <D7E9803B-18EC-4E23-BD3A-4A3B7802C735@dilger.ca>
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@gmail.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
next prev parent reply other threads:[~2014-07-09 3:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 20:41 [PATCH] e2fsprogs: journal code small cleanup and fixes Azat Khuzhin
2014-07-08 20:41 ` [PATCH 1/3] journal: use consts instead of 1024 and add helper for journal with 1k blocksize Azat Khuzhin
2014-07-08 23:30 ` Andreas Dilger
2014-07-09 3:51 ` Azat Khuzhin [this message]
2014-07-09 3:56 ` [PATCH 1/3 v2] " Azat Khuzhin
2014-07-09 4:46 ` Andreas Dilger
2014-07-09 4:54 ` Azat Khuzhin
2014-07-09 18:57 ` Darrick J. Wong
2014-07-09 19:36 ` Azat Khuzhin
2014-07-09 19:39 ` [PATCH 1/3 v3] " Azat Khuzhin
2014-07-09 20:33 ` Andreas Dilger
2014-07-08 20:41 ` [PATCH 2/3] tune2fs: remove_journal_device(): use the correct block to find jsb Azat Khuzhin
2014-07-09 4:48 ` Andreas Dilger
2014-07-08 20:41 ` [PATCH 3/3] tune2fs: update journal super block when changing UUID for fs Azat Khuzhin
2014-07-09 20:38 ` Andreas Dilger
2014-07-10 6:03 ` Azat Khuzhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140709035136.GF4622@azat \
--to=a3at.mail@gmail.com \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).