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]
Date:	Fri, 28 Oct 2011 15:57:16 -0700
From:	Dave Hansen <haveblue@...ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	holzheu@...ux.vnet.ibm.com,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Vivek Goyal <vgoyal@...hat.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	schwidefsky@...ibm.com, kexec@...ts.infradead.org,
	linux-kernel@...r.kernel.org, Kay Sievers <kay.sievers@...y.org>
Subject: Re: [PATCH] kdump: Add udev events for memory online/offline

On Fri, 2011-10-28 at 15:41 -0700, Andrew Morton wrote:
> > +     } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> >               ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> > -
> > +             if (ret == 0)
> > +                     kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> > +     }
> 
> ot: what on earth is up with that min() thing which
> Dave-who-doesn't-know-about-min_t added to the strncmp() calls?

My first reaction was, "that's not my code!", but git seems to disagree
with me.  So I'll go and blame it on being young and stupid in 2005.

Reading it, I also think it's probably buggy.

	echo -n "o" > state
 
would be interesting.  I think it'll fall in to the 'online' case.
While probably not that common, it's certainly unexpected.  I'll send a
patch to fix it up.

-- Dave

--
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