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: <D0B55F56.D05F1%andreas.dilger@intel.com>
Date:	Tue, 16 Dec 2014 11:14:35 +0000
From:	"Dilger, Andreas" <andreas.dilger@...el.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>,
	Chris Rorvick <chris@...vick.com>
CC:	"Drokin, Oleg" <oleg.drokin@...el.com>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"HPDD-discuss@...1.01.org" <HPDD-discuss@...1.01.org>,
	Greg Donald <gdonald@...il.com>,
	James Simmons <uja.ornl@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Fabian Frederick" <fabf@...net.be>,
	Julia Lawall <Julia.Lawall@...6.fr>,
	"Andriy Skulysh" <Andriy_Skulysh@...atex.com>,
	"Hammond, John" <john.hammond@...el.com>
Subject: Re: [PATCH] drivers: staging: lustre: Use mult if units not
 specified

On 2014/12/16, 2:41 AM, "Dan Carpenter" <dan.carpenter@...cle.com> wrote:

>On Mon, Dec 15, 2014 at 11:41:49PM -0600, Chris Rorvick wrote:
>> Units can be passed to lprocfs_write_frac_u64_helper() via a suffix
>> (e.g., "...K", "...M", etc.) tacked onto the value.  A comment states
>> that "specified units override the multiplier," though the multiplier is
>> overridden regardless.  Update the conditional logic so that it only
>> applies when units are specified.
>> 
>
>That introduces a bug.  We need to take the initial '-' into
>consideration.  Just remove the condition.  Also remove the "mult"
>parameter since that is always 1.
>
>	bool negative = false;
>
>	...
>
>	if (*pbuf == '-') {
>		negative = true;
>		pbuf++;
>	}
>
>	...
>
>	mult = negative ? -units : units;

Sorry, that isn't right.  Chris' patch is actually doing the right thing
to check for units > 1.  The proposed change above discards "mult"
entirely, which breaks the users of this function that are not in this
file (e.g. osc_cached_mb_seq_write() or ll_max_cached_mb_seq_write())
that have tunables in units of MB by default, but can also use parameters
with units like "4.5G" for convenience.

Cheers, Andreas
-- 
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division


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