Re: [PATCH 1/3] journal: use consts instead of 1024 and add helper for journal with 1k blocksize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux