Re: [PATCH] ext2 allocation failures

From: Andrew Morton (akpm@digeo.com)
Date: Tue Jan 21 2003 - 16:18:14 EST


Hugh Dickins wrote:
>
> For almost a year (since 2.5.4) ext2_new_block has tended to set err
> 0 instead of -ENOSPC or -EIO. This manifested variously (typically
> depends on what's stale in ext2_get_block's chain[4] array): sometimes
> __brelse free free buffer backtraces, sometimes release_pages oops,
> usually generic_make_request beyond end of device messages, followed
> by further ext2 errors.

ugh.

> [Insert lecture on dangers of using goto for unwind :-]

Actually, I rather don't like the practice of:

        *errp = -EFOO;
        <200 lines of code>
        if (something_bad)
                goto out;

And lo, both ext2_new_block() and ext3_new_block() have additional
bugs, due mainly to this dubious optimisation.

I'll change them to the very straightforward

        if (something_bad) {
                *errp = -EFOO;
                goto out;
        }

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:27 EST