All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valerie Clement <valerie.clement@bull.net>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [RFC][PATCH 4/4] BIG_BG: block group descriptor modifications
Date: Thu, 30 Nov 2006 17:04:31 +0100	[thread overview]
Message-ID: <456F010F.4020704@bull.net> (raw)
In-Reply-To: <20061125092346.GA4241@schatzie.adilger.int>

Andreas Dilger wrote:
> On Nov 24, 2006  17:48 +0100, Valerie Clement wrote:
>> @@ -133,6 +133,9 @@ struct ext4_group_desc
>>  	__le32	bg_block_bitmap_hi;	/* Blocks bitmap block MSB */
>>  	__le32	bg_inode_bitmap_hi;	/* Inodes bitmap block MSB */
>>  	__le32	bg_inode_table_hi;	/* Inodes table block MSB */
>> +	__le16	bg_free_blocks_count_hi;	/* Free blocks count MSB */
>> +	__le16	bg_free_inodes_count_hi;	/* Free inodes count MSB */
>> +	__le16	bg_used_dirs_count_hi;	/* Directories count MSB */
>>  };
> 
> Does the ext4 code already avoid using "sizeof(struct ext4_group_desc)"
> or "sizeof(*gdp)" everywhere?  Otherwise this is very dangerous.
Currently, the code doesn't use sizeof of the structure or of a group 
descriptor, but do you mean that adding padding to the structure is better?

> 
> Also note that the on-disk layout of this struct in e2fsprogs is a bit
> incorrect - it has the above 3 __u16, but then immediately __u32 bg_reserved
> so those fields are padded incorrectly.  I think it isn't a fatal problem,
> just something to be aware of and fix.
OK.

> 
>> +#define EXT4_READ_SPLIT_LE32(__sb, __field)	\
>> +	((__u32)le16_to_cpu(__field) +		\
>> +	 (EXT4_HAS_INCOMPAT_FEATURE((__sb), EXT4_FEATURE_INCOMPAT_64BIT) ? \
>> +	 (__u32)le16_to_cpu(__field##_hi) << 16 : 0))
> 
> Is it better to make this INCOMPAT_64BIT or s_desc_size? Does INCOMPAT_64BIT
> always imply s_desc_size > 32?  Hmm, I guess it does, or we have no place to
> store the _hi part of the block addresses for a group.
I prefer using INCOMPAT_64BIT rather than s_desc_size.
Thank you Andreas to point that out, I missed to update my e2fsprogs 
version to initialize s_desc_size with the right value in some cases.

   Valérie

  reply	other threads:[~2006-11-30 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 16:48 [RFC][PATCH 4/4] BIG_BG: block group descriptor modifications Valerie Clement
2006-11-25  9:23 ` Andreas Dilger
2006-11-30 16:04   ` Valerie Clement [this message]
2006-11-30 19:49   ` Theodore Tso

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=456F010F.4020704@bull.net \
    --to=valerie.clement@bull.net \
    --cc=adilger@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.