Skip to contentSkip to conversation

ext3-orlov for 2.4

BUG J.A. Magallon 2 participants 2 messages Nov 30, 2002

lore
Share & tools
lore
#0 lore raw

HI all...

Tell me if this is correct. GCC-3.2 spits a wrning like this when building -jam, I did not noticed before:

ialloc.c: In function `ext3_new_inode':
ialloc.c:546: warning: comparison between pointer and integer ialloc.c:682: warning: label out' defined but not used ialloc.c:520: warning: gdp' might be used uninitialized in this function

Line is question is:

    if (gdp == -1)
        goto fail;

It comes from the orlov-allocator for ext3.

Looking at the structure of ext3_new_inode:

struct inode * ext3_new_inode (handle_t *handle, struct inode * dir, int mode)

{
    ...
    struct ext3_group_desc * gdp;

repeat:

    ...
    if (gdp == -1)
        goto fail;
    ...
    gdp = ext3_get_group_desc (sb, group, &bh2);
    ...                    

Thigs to note:
- gdp is used without previous initialization.
- gdp is a pointer and is compared with -1

Should not the structure be:

    gdp = ext3_get_group_desc (sb, group, &bh2);
    if (!gdp)
        goto fail;

Can anybody check 2.5 for this also ?

???

TIA

Signature · 4 lines
J.A. Magallon <[email protected]>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.20-jam0 (gcc 3.2 (Mandrake Linux 9.1 3.2-4mdk))
#1 lore raw
Quoted 11 lines · J.A. Magallon

HI all...

Tell me if this is correct. GCC-3.2 spits a wrning like this when building -jam, I did not noticed before:

ialloc.c: In function `ext3_new_inode':
ialloc.c:546: warning: comparison between pointer and integer ialloc.c:682: warning: label out' defined but not used ialloc.c:520: warning: gdp' might be used uninitialized in this function

Quoted 4 lines

Line is question is:

    if (gdp == -1)
        goto fail;

It comes from the orlov-allocator for ext3.

gdp will be NULL on failure. The above code isn't right.

Quoted 4 lines

Should not the structure be:

    gdp = ext3_get_group_desc (sb, group, &bh2);
    if (!gdp)
        goto fail;

yes.

Quoted 2 lines

Can anybody check 2.5 for this also ?

Is OK.