The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.4.18-pre4
Date: Wed, 16 Jan 2002 01:32:10 -0800	[thread overview]
Message-ID: <3C45489A.718A5F86@zip.com.au> (raw)
In-Reply-To: <Pine.LNX.4.21.0201151955460.27118-100000@freak.distro.conectiva>, <Pine.LNX.4.21.0201151955460.27118-100000@freak.distro.conectiva>; from marcelo@conectiva.com.br on Tue, Jan 15, 2002 at 07:56:38PM -0200 <20020116102256.C824@nightmaster.csn.tu-chemnitz.de>

Ingo Oeser wrote:
> 
> On Tue, Jan 15, 2002 at 07:56:38PM -0200, Marcelo Tosatti wrote:
> [pre4 Announcement]
> 
> What is this hunk supposed to do?
> diff -urN linux-2.4.18-pre3/fs/buffer.c linux/fs/buffer.c
> --- linux-2.4.18-pre3/fs/buffer.c   Fri Dec 21 09:41:55 2001
> +++ linux/fs/buffer.c   Tue Jan 15 15:10:18 2002
> @@ -1633,12 +1671,34 @@
>     */
>    while(wait_bh > wait) {
>       wait_on_buffer(*--wait_bh);
> -     err = -EIO;
>       if (!buffer_uptodate(*wait_bh))
> -        goto out;
> +        return -EIO;
>    }
>    return 0;
>  out:
> +  /*
> +   * Zero out any newly allocated blocks to avoid exposing stale
> +   * data.  If BH_New is set, we know that the block was newly
> +   * allocated in the above loop.
> +   */
> +  bh = head;
> +  block_start = 0;
> [1]
> +  do {
> +     block_end = block_start+blocksize;
> +     if (block_end <= from)
> +        continue;
> [2]
> 
> The situation between [1] and [2] won't change, so I don't
> understand the "continue" here and think it will either never be
> triggered or an endless loop.
> 

Good eyes.  I missed that in both reviewing and in testing.

I'll go test this:

--- linux-2.4.18-pre4/fs/buffer.c	Tue Jan 15 15:08:25 2002
+++ linux-akpm/fs/buffer.c	Wed Jan 16 01:30:25 2002
@@ -1686,7 +1686,7 @@ out:
 	do {
 		block_end = block_start+blocksize;
 		if (block_end <= from)
-			continue;
+			goto next_bh;
 		if (block_start >= to)
 			break;
 		if (buffer_new(bh)) {
@@ -1696,6 +1696,7 @@ out:
 			set_bit(BH_Uptodate, &bh->b_state);
 			mark_buffer_dirty(bh);
 		}
+next_bh:
 		block_start = block_end;
 		bh = bh->b_this_page;
 	} while (bh != head);

  reply	other threads:[~2002-01-16  9:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-15 21:56 Linux 2.4.18-pre4 Marcelo Tosatti
2002-01-16  0:29 ` Stephan von Krawczynski
2002-01-15 23:23   ` Marcelo Tosatti
2002-01-16  9:22 ` Ingo Oeser
2002-01-16  9:32   ` Andrew Morton [this message]
2002-01-16  9:44   ` Alexander Viro
2002-01-16 10:33 ` Linux 2.4.18-pre4: missing cs4281_wrapper.h Eyal Lebedinsky
2002-01-16 10:36 ` Linux 2.4.18-pre4 Matthias Andree

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=3C45489A.718A5F86@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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