public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext2 allocation failures
Date: Tue, 21 Jan 2003 13:18:14 -0800	[thread overview]
Message-ID: <3E2DB916.CA2221CC@digeo.com> (raw)
In-Reply-To: Pine.LNX.4.44.0301212043250.2751-100000@localhost.localdomain

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.

      reply	other threads:[~2003-01-21 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-21 20:54 [PATCH] ext2 allocation failures Hugh Dickins
2003-01-21 21:18 ` Andrew Morton [this message]

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=3E2DB916.CA2221CC@digeo.com \
    --to=akpm@digeo.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    /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