Patchwork [U-Boot] fs/ext4: caculate log2blksz from blksz, other its value = 0

login
register
mail settings
Submitter Dennis Lan (dlan)
Date June 27, 2013, 9:42 a.m.
Message ID <1372326151-22868-1-git-send-email-dennis.yxun@gmail.com>
Download mbox | patch
Permalink /patch/255032/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Dennis Lan (dlan) - June 27, 2013, 9:42 a.m.
From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>

err:
lt703a # ext4ls nand 3:0
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **

bug may introduced by commit:

commit 50ce4c07df1c98aabf4630b35152ed95a87242f7
Author: Egbert Eich <eich@suse.com>
Date:   Wed May 1 01:13:19 2013 +0000

    fs/ext4: Support device block sizes != 512 bytes

Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
 disk/part.c | 4 ++++
 1 file changed, 4 insertions(+)
Albert ARIBAUD - June 27, 2013, 10:17 a.m.
Hi Lan,

On Thu, 27 Jun 2013 17:42:31 +0800, "Lan Yixun (dlan)"
<dennis.yxun@gmail.com> wrote:

> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
> 
> err:
> lt703a # ext4ls nand 3:0
> Failed to mount ext2 filesystem...
> ** Unrecognized filesystem type **
> 
> bug may introduced by commit:
> 
> commit 50ce4c07df1c98aabf4630b35152ed95a87242f7
> Author: Egbert Eich <eich@suse.com>
> Date:   Wed May 1 01:13:19 2013 +0000
> 
>     fs/ext4: Support device block sizes != 512 bytes

Please make the commit summary a description of what is wrong and how
it is fixed, and move the context (how the bug was found, console
output, etc) after the commit message separator '---' below.

Also, fix probably typo in the commit summary (first commit message
line) ("other" for "otherwise").

> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
> ---
>  disk/part.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/disk/part.c b/disk/part.c
> index fc8404d..dbc94c4 100644
> --- a/disk/part.c
> +++ b/disk/part.c
> @@ -551,6 +551,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>  			goto cleanup;
>  		}
>  
> +		(*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
> +
>  		info->start = 0;
>  		info->size = (*dev_desc)->lba;
>  		info->blksz = (*dev_desc)->blksz;
> @@ -634,6 +636,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>  		goto cleanup;
>  	}
>  
> +	(*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
> +
>  	ret = part;
>  	goto cleanup;
>  


Amicalement,
Dennis Lan (dlan) - June 28, 2013, 1:47 a.m.
Hi Albert, Eich

On Thu, Jun 27, 2013 at 6:17 PM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Hi Lan,
>
> On Thu, 27 Jun 2013 17:42:31 +0800, "Lan Yixun (dlan)"
> <dennis.yxun@gmail.com> wrote:
>
>> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
>>
>> err:
>> lt703a # ext4ls nand 3:0
>> Failed to mount ext2 filesystem...
>> ** Unrecognized filesystem type **
>>
>> bug may introduced by commit:
>>
>> commit 50ce4c07df1c98aabf4630b35152ed95a87242f7
>> Author: Egbert Eich <eich@suse.com>
>> Date:   Wed May 1 01:13:19 2013 +0000
>>
>>     fs/ext4: Support device block sizes != 512 bytes
>
> Please make the commit summary a description of what is wrong and how
> it is fixed, and move the context (how the bug was found, console
> output, etc) after the commit message separator '---' below.
>
> Also, fix probably typo in the commit summary (first commit message
> line) ("other" for "otherwise").
>
Thanks for your comments
I'm sending this patch mainly for pre-review, Eich, Can you have a look?
Since you are original patch author.

The problem here is that uboot can't mount ext4 filesystem with
commit "50ce4c07df1" applied. As I looking into the code,
 we use hard-coded "SECTOR_SIZE"(512) previously,
 but now we introduce (block_dev_desc_t *)->log2blksz,
and problem here is that I couldn't find where/when this value been set.
And after calling do_ls()->fs_set_blk_dev(), the value of log2blksz
we got is still 0 (initialized value), which I think it's not correct.
As I haven't dig too much into the code, and just cook this as a quick fix..

I'm trying to solve this by calculating log2blksz from blksz.



>> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
>> ---
>>  disk/part.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/disk/part.c b/disk/part.c
>> index fc8404d..dbc94c4 100644
>> --- a/disk/part.c
>> +++ b/disk/part.c
>> @@ -551,6 +551,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>>                       goto cleanup;
>>               }
>>
>> +             (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
>> +
>>               info->start = 0;
>>               info->size = (*dev_desc)->lba;
>>               info->blksz = (*dev_desc)->blksz;
>> @@ -634,6 +636,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>>               goto cleanup;
>>       }
>>
>> +     (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
>> +
>>       ret = part;
>>       goto cleanup;
>>
>
>
> Amicalement,
> --
> Albert.
Dennis Lan (dlan) - July 19, 2013, 12:36 p.m.
On Fri, Jun 28, 2013 at 9:47 AM, Dennis Lan (dlan)
<dennis.yxun@gmail.com> wrote:
> Hi Albert, Eich
>
> On Thu, Jun 27, 2013 at 6:17 PM, Albert ARIBAUD
> <albert.u.boot@aribaud.net> wrote:
>> Hi Lan,
>>
>> On Thu, 27 Jun 2013 17:42:31 +0800, "Lan Yixun (dlan)"
>> <dennis.yxun@gmail.com> wrote:
>>
>>> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
>>>
>>> err:
>>> lt703a # ext4ls nand 3:0
>>> Failed to mount ext2 filesystem...
>>> ** Unrecognized filesystem type **
>>>
>>> bug may introduced by commit:
>>>
>>> commit 50ce4c07df1c98aabf4630b35152ed95a87242f7
>>> Author: Egbert Eich <eich@suse.com>
>>> Date:   Wed May 1 01:13:19 2013 +0000
>>>
>>>     fs/ext4: Support device block sizes != 512 bytes
>>
>> Please make the commit summary a description of what is wrong and how
>> it is fixed, and move the context (how the bug was found, console
>> output, etc) after the commit message separator '---' below.
>>
>> Also, fix probably typo in the commit summary (first commit message
>> line) ("other" for "otherwise").
>>
> Thanks for your comments
> I'm sending this patch mainly for pre-review, Eich, Can you have a look?
> Since you are original patch author.
>
> The problem here is that uboot can't mount ext4 filesystem with
> commit "50ce4c07df1" applied. As I looking into the code,
>  we use hard-coded "SECTOR_SIZE"(512) previously,
>  but now we introduce (block_dev_desc_t *)->log2blksz,
> and problem here is that I couldn't find where/when this value been set.
> And after calling do_ls()->fs_set_blk_dev(), the value of log2blksz
> we got is still 0 (initialized value), which I think it's not correct.
> As I haven't dig too much into the code, and just cook this as a quick fix..
>
> I'm trying to solve this by calculating log2blksz from blksz.
>
>
>
>>> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
>>> ---
>>>  disk/part.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/disk/part.c b/disk/part.c
>>> index fc8404d..dbc94c4 100644
>>> --- a/disk/part.c
>>> +++ b/disk/part.c
>>> @@ -551,6 +551,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>>>                       goto cleanup;
>>>               }
>>>
>>> +             (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
>>> +
>>>               info->start = 0;
>>>               info->size = (*dev_desc)->lba;
>>>               info->blksz = (*dev_desc)->blksz;
>>> @@ -634,6 +636,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
>>>               goto cleanup;
>>>       }
>>>
>>> +     (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
>>> +
>>>       ret = part;
>>>       goto cleanup;
>>>
>>
>>
>> Amicalement,
>> --
>> Albert.

hi Eich, Albert:

ping, any comments? or should I send another patch as v2?
Albert ARIBAUD - July 19, 2013, 1:58 p.m.
Hi Dennis,

On Fri, 19 Jul 2013 20:36:33 +0800, "Dennis Lan (dlan)"
<dennis.yxun@gmail.com> wrote:

> On Fri, Jun 28, 2013 at 9:47 AM, Dennis Lan (dlan)
> <dennis.yxun@gmail.com> wrote:
> > Hi Albert, Eich
> >
> > On Thu, Jun 27, 2013 at 6:17 PM, Albert ARIBAUD
> > <albert.u.boot@aribaud.net> wrote:
> >> Hi Lan,
> >>
> >> On Thu, 27 Jun 2013 17:42:31 +0800, "Lan Yixun (dlan)"
> >> <dennis.yxun@gmail.com> wrote:
> >>
> >>> From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
> >>>
> >>> err:
> >>> lt703a # ext4ls nand 3:0
> >>> Failed to mount ext2 filesystem...
> >>> ** Unrecognized filesystem type **
> >>>
> >>> bug may introduced by commit:
> >>>
> >>> commit 50ce4c07df1c98aabf4630b35152ed95a87242f7
> >>> Author: Egbert Eich <eich@suse.com>
> >>> Date:   Wed May 1 01:13:19 2013 +0000
> >>>
> >>>     fs/ext4: Support device block sizes != 512 bytes
> >>
> >> Please make the commit summary a description of what is wrong and how
> >> it is fixed, and move the context (how the bug was found, console
> >> output, etc) after the commit message separator '---' below.
> >>
> >> Also, fix probably typo in the commit summary (first commit message
> >> line) ("other" for "otherwise").
> >>
> > Thanks for your comments
> > I'm sending this patch mainly for pre-review, Eich, Can you have a look?
> > Since you are original patch author.
> >
> > The problem here is that uboot can't mount ext4 filesystem with
> > commit "50ce4c07df1" applied. As I looking into the code,
> >  we use hard-coded "SECTOR_SIZE"(512) previously,
> >  but now we introduce (block_dev_desc_t *)->log2blksz,
> > and problem here is that I couldn't find where/when this value been set.
> > And after calling do_ls()->fs_set_blk_dev(), the value of log2blksz
> > we got is still 0 (initialized value), which I think it's not correct.
> > As I haven't dig too much into the code, and just cook this as a quick fix..
> >
> > I'm trying to solve this by calculating log2blksz from blksz.
> >
> >
> >
> >>> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
> >>> ---
> >>>  disk/part.c | 4 ++++
> >>>  1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/disk/part.c b/disk/part.c
> >>> index fc8404d..dbc94c4 100644
> >>> --- a/disk/part.c
> >>> +++ b/disk/part.c
> >>> @@ -551,6 +551,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
> >>>                       goto cleanup;
> >>>               }
> >>>
> >>> +             (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
> >>> +
> >>>               info->start = 0;
> >>>               info->size = (*dev_desc)->lba;
> >>>               info->blksz = (*dev_desc)->blksz;
> >>> @@ -634,6 +636,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
> >>>               goto cleanup;
> >>>       }
> >>>
> >>> +     (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
> >>> +
> >>>       ret = part;
> >>>       goto cleanup;
> >>>
> >>
> >>
> >> Amicalement,
> >> --
> >> Albert.
> 
> hi Eich, Albert:
> 
> ping, any comments? or should I send another patch as v2?

Well, you've had comments already from me, and it's been three weeks,
so I reckon any other comment would have popped up by now.

Amicalement,

Patch

diff --git a/disk/part.c b/disk/part.c
index fc8404d..dbc94c4 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -551,6 +551,8 @@  int get_device_and_partition(const char *ifname, const char *dev_part_str,
 			goto cleanup;
 		}
 
+		(*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
+
 		info->start = 0;
 		info->size = (*dev_desc)->lba;
 		info->blksz = (*dev_desc)->blksz;
@@ -634,6 +636,8 @@  int get_device_and_partition(const char *ifname, const char *dev_part_str,
 		goto cleanup;
 	}
 
+	(*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
+
 	ret = part;
 	goto cleanup;