mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <willy@w.ods.org>
To: "O.Sezer" <sezeroz@ttnet.net.tr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.28-pre2 and ntfs-2.1.6b ?
Date: Fri, 27 Aug 2004 00:12:29 +0200	[thread overview]
Message-ID: <20040826221229.GB564@alpha.home.local> (raw)
In-Reply-To: <412E4F43.9030801@ttnet.net.tr>

Hi,

On Thu, Aug 26, 2004 at 11:59:47PM +0300, O.Sezer wrote:
> Hi all:
> 
> With 2.4.28-pre2, ntfs-2.1.6b from linux-ntfs site
> started failing to compile at aops.c:
> 
> aops.c: In function `ntfs_read_block':
> aops.c:315: parse error before "else"
> -- or in case of gcc3.4 --
> aops.c:315: error: syntax error before "else"
> 
> This happens with gcc-3.2.2 and gcc-3.4.0
> and can be fixed by:
> 
> --- aops.c.BAK	2004-08-26 19:35:11.000000000 +0300
> +++ aops.c	2004-08-26 21:41:53.000000000 +0300
> @@ -310,10 +310,11 @@
>  		return 0;
>  	}
>  	/* No i/o was scheduled on any of the buffers. */
> -	if (likely(!PageError(page)))
> +	if (likely(!PageError(page))) {
>  		SetPageUptodate(page);
> -	else /* Signal synchronous i/o error. */
> +	} else { /* Signal synchronous i/o error. */
>  		nr = -EIO;
> +	}
>  	unlock_page(page);
>  	return nr;
>  }

No !
Please don't fix it this way ! The problem lies within the declaration of
SetPageUptodate() which it seems is a macro which lacks some braces somewhere.
You were very lucky that there was an 'else' to point it out, but imagine
what it would do in the following case :

	if (likely(!PageError(page))) {
 		SetPageUptodate(page);
	blah();

It would always execute the second half of SetPageUptodate(), whatever
the condition, and nothing will alert you.

What does SetPageUptodate() look like ?

> The very same code used to compile fine with
> 2.4.27 without any changes to it.

I think that the gcc-3.4 fixes might have hit some sensible parts...

> I can't see
> where the problem is (it's 23:57 here ;)).
> Can anyone tell, please?

It's even later now, good night :-)

Regards,
Willy


  reply	other threads:[~2004-08-26 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-26 20:59 O.Sezer
2004-08-26 22:12 ` Willy Tarreau [this message]
2004-08-26 22:53   ` O.Sezer
2004-08-27  0:08     ` [PATCH 2.4] fix typo in mm.h introduced 2.4.28-pre2 O.Sezer
2004-08-27  9:04       ` Mikael Pettersson

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=20040826221229.GB564@alpha.home.local \
    --to=willy@w.ods.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sezeroz@ttnet.net.tr \
    /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

all inboxes | Powered by JetHome®