public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Avantika Mathur <mathur@linux.vnet.ibm.com>
Cc: linux-ext4@vger.kernel.org, Girish Shilamkar <girish@clusterfs.com>
Subject: Re: [PATCH] uninitialized groups ported - kernel
Date: Tue, 19 Jun 2007 01:50:34 -0600	[thread overview]
Message-ID: <20070619075034.GQ5181@schatzie.adilger.int> (raw)
In-Reply-To: <467755D3.8030802@linux.vnet.ibm.com>

On Jun 18, 2007  21:04 -0700, Avantika Mathur wrote:
> Here is the uninitialized block group patch, rebased to the ext4 git 
> tree, after ext4_remove_subdirs_limit.patch.
> Andreas, please let me know if there are any issues with the patch

> +__le16 ext4_group_desc_csum(struct ext4_sb_info *sbi, __u32 block_group,
> +			    struct ext4_group_desc *gdp)
> +{
> +	__u16 crc = 0;
> +
> +	if (sbi->s_es->s_feature_ro_compat &
> +	    cpu_to_le32(EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
> +		int offset = offsetof(struct ext4_group_desc, bg_checksum);
> +		__le32 le_group = cpu_to_le32(block_group);
> +
> +		crc = crc16(~0, sbi->s_es->s_uuid, sizeof(sbi->s_es->s_uuid));
> +		crc = crc16(crc, (__u8 *)&le_group, sizeof(le_group));
> +		crc = crc16(crc, (__u8 *)gdp, offset);
> +		offset += sizeof(gdp->bg_checksum); /* skip checksum */
> +		/*BUG_ON(offset != sizeof(*gdp)); /* XXX handle s_desc_size */
> +		/* for checksum of struct ext4_group_desc do the rest...*/
> +		if (offset < sbi->s_es->s_desc_size) {

This is missing an le16_to_cpu(sbi->s_es->s_desc_size) conversion.  I missed
it in my sparse checking because it was commented out.  Also, s_desc_size is
only valid in conjunction with INCOMPAT_64BIT I think, so that should be
checked also.

> @@ -681,6 +687,7 @@ static inline int ext4_valid_inum(struct
>  #define EXT4_FEATURE_COMPAT_EXT_ATTR		0x0008
>  #define EXT4_FEATURE_COMPAT_RESIZE_INODE	0x0010
>  #define EXT4_FEATURE_COMPAT_DIR_INDEX		0x0020
> +#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM		0x0040

This is the wrong feature number.  It should be 0x0010 as in the original
patch, and as reserved in the upstream e2fsprogs.  The confusion is because
you added this to the "FEATURE_COMPAT" section instead of the
FEATURE_RO_COMPAT section of the headers.

I've asked Girish to send an incremental patch.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

  reply	other threads:[~2007-06-19  7:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 17:48 [PATCH] uninitialized groups ported - kernel Avantika Mathur
2007-06-05 18:48 ` Eric Sandeen
2007-06-05 21:20   ` Andreas Dilger
2007-06-19  4:04     ` Avantika Mathur
2007-06-19  7:50       ` Andreas Dilger [this message]
2007-06-20 11:56         ` Girish Shilamkar
2007-06-21 17:37           ` Andreas Dilger
2007-06-21 23:54             ` Avantika Mathur
2007-06-22 16:04               ` Andreas Dilger
2007-06-22 16:20               ` Dave Kleikamp

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=20070619075034.GQ5181@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=girish@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mathur@linux.vnet.ibm.com \
    /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