Re: [patch] limit error rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux