All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Pierre Dion <jean-pierre.dion@bull.net>
To: Andreas Dilger <adilger@sun.com>
Cc: frederic.bohe@ext.bull.net, tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: fix online resize group descriptors corruption
Date: Thu, 12 Jun 2008 16:56:55 +0200	[thread overview]
Message-ID: <48513937.5000708@bull.net> (raw)
In-Reply-To: <20080612105945.GB3726@webber.adilger.int>

Hi Andreas,

thank you for this review of Frédéric's patch
and your comments that help.

Frédéric just joined our team a few days ago and
this kind of help is very usefull.

Frédéric has not a great experience in Linux
but he has a strong one in embedded systems
and telecoms. Correct me where I am wrong Frédéric. ;-)


jean-pierre


Andreas Dilger a écrit :
> On Jun 12, 2008  11:42 +0200, Fr�d�ric Boh� wrote:
>   
>> From: Frederic Bohe <frederic.bohe@bull.net>
>>
>> This is the patch for the group descriptor table corruption during
>> online resize pointed out by Theodore Tso.
>> The issue was due to the ext4 group descriptor which can be either
>> 32 or 64 bytes long.
>> Only the 64 bytes structure was taken into account.
>>
>> diff -rup a/fs/ext4/resize.c b/fs/ext4/resize.c
>> --- a/fs/ext4/resize.c
>> +++ b/fs/ext4/resize.c
>> @@ -855,7 +855,8 @@ int ext4_group_add(struct super_block *s
>>  	 */
>>  
>>  	/* Update group descriptor block for new group */
>> -	gdp = (struct ext4_group_desc *)primary->b_data + gdb_off;
>> +	gdp = (struct ext4_group_desc *)(
>> +	       (__u8 *)primary->b_data + gdb_off * EXT4_DESC_SIZE(sb));
>>     
>
> Normally pointer arithmetic is done by casting to (char *)...
> Otherwise, patch looks sensible, though it could be reformatted to 
> match the normal coding style a bit better:
>
> 	gdp = (struct ext4_group_desc *)((char *)primary->b_data +
> 					 gdb_off * EXT4_DESC_SIZE(sb));
>
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-06-12 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  9:42 [PATCH] ext4: fix online resize group descriptors corruption Frédéric Bohé
2008-06-12 10:59 ` Andreas Dilger
2008-06-12 13:35   ` [PATCH v2] " Frédéric Bohé
2008-06-12 14:14     ` [PATCH v3] " Frédéric Bohé
2008-06-12 14:56   ` Jean-Pierre Dion [this message]
2008-06-12 19:04 ` [PATCH] " Theodore Tso
2008-06-13 12:33   ` Frédéric Bohé

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=48513937.5000708@bull.net \
    --to=jean-pierre.dion@bull.net \
    --cc=adilger@sun.com \
    --cc=frederic.bohe@ext.bull.net \
    --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 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.