From: Bernd Schubert <bernd-schubert@gmx.de>
To: Neil Brown <neilb@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>, linux-raid@vger.kernel.org
Subject: Re: [patch] limit error rate
Date: Mon, 28 Apr 2008 23:33:17 +0200 [thread overview]
Message-ID: <200804282333.18172.bernd-schubert@gmx.de> (raw)
In-Reply-To: <18453.11291.797493.538474@notabene.brown>
On Monday 28 April 2008, Neil Brown wrote:
> This is not good, you are subtly changing semantics.
> You have changed:
>
> if (A)
> X;
> else if (B)
> Y;
> else if (C)
> Z;
> else
> W;
>
> to
> if (A && foo())
> X;
> else if (B && foo())
> Y;
> else if (C && foo())
> Z;
> else
> W;
>
> If 'A' and not 'foo()', you want nothing to happen, but you will
> actually get one of Y, Z, or W happening, all of which are wrong.
Ouch, right. I shouldn't write patches in the middle of the night...
>
> > Btw, from my point of view the
> >
> > if (printk_ratelimit())
> > printk("print output");
> >
> > looks odd. I just don't see why the API isn't
> >
> > printk_ratelimit("print output");
>
> Very sensible. I've put
>
> #define printk_rl printk_ratelimit() ?: printk
>
> at the start of raid5.c, and used it to fix the problematic printks.
Great!
Thanks a lot,
Bernd
prev parent reply other threads:[~2008-04-28 21:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-12 18:16 [patch] limit error rate Bernd Schubert
2008-04-23 0:44 ` Dan Williams
2008-04-23 22:55 ` Bernd Schubert
2008-04-28 1:44 ` Neil Brown
2008-04-28 21:33 ` Bernd Schubert [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=200804282333.18172.bernd-schubert@gmx.de \
--to=bernd-schubert@gmx.de \
--cc=dan.j.williams@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).