lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17986.59902.831796.721280@notabene.brown>
Date:	Thu, 10 May 2007 19:46:38 +1000
From:	Neil Brown <neilb@...e.de>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 002 of 2] md: Improve the is_mddev_idle test

On Thursday May 10, akpm@...ux-foundation.org wrote:
> On Thu, 10 May 2007 16:22:31 +1000 NeilBrown <neilb@...e.de> wrote:
> 
> > The test currently looks for any (non-fuzz) difference, either
> > positive or negative.  This clearly is not needed.  Any non-sync
> > activity will cause the total sectors to grow faster than the sync_io
> > count (never slower) so we only need to look for a positive differences.
> > 
> > ...
> >
> > --- .prev/drivers/md/md.c	2007-05-10 15:51:54.000000000 +1000
> > +++ ./drivers/md/md.c	2007-05-10 16:05:10.000000000 +1000
> > @@ -5095,7 +5095,7 @@ static int is_mddev_idle(mddev_t *mddev)
> >  		 *
> >  		 * Note: the following is an unsigned comparison.
> >  		 */
> > -		if ((curr_events - rdev->last_events + 4096) > 8192) {
> > +		if ((long)curr_events - (long)rdev->last_events > 4096) {
> >  			rdev->last_events = curr_events;
> >  			idle = 0;
> 
> In which case would unsigned counters be more appropriate?

I guess.....

It is really the comparison that I want to be signed, I don't much
care about the counted - they are expected to wrap (though they might
not).
So maybe I really want

     if ((signed long)(curr_events - rdev->last_events) > 4096) {

to make it clear...
But people expect number to be signed by default, so that probably
isn't necessary.

Yeah, I'll make them signed one day.

Thanks,
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ