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:	Tue, 16 Dec 2014 16:54:59 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Chris Rorvick <chris@...vick.com>
Cc:	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"Drokin, Oleg" <oleg.drokin@...el.com>,
	"Dilger, Andreas" <andreas.dilger@...el.com>,
	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	James Simmons <uja.ornl@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Greg Donald <gdonald@...il.com>,
	"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>,
	"HPDD-discuss@...1.01.org" <HPDD-discuss@...1.01.org>,
	"Hammond, John" <john.hammond@...el.com>
Subject: Re: [PATCH] drivers: staging: lustre: Use mult if units not specified

On Tue, Dec 16, 2014 at 06:53:19AM -0600, Chris Rorvick wrote:
> On Tue, Dec 16, 2014 at 5:35 AM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> > On Tue, Dec 16, 2014 at 11:14:35AM +0000, Dilger, Andreas wrote:
> > >
> > > Sorry, that isn't right.  Chris' patch is actually doing the right thing
> > > to check for units > 1.
> >
> > It's not right because it discards the negative.
> 
> I don't think this patch introduces a bug.  If anything, it was already
> there.

The original code may be totally buggy.  Who knows?  Why are we passing
negative numbers here anyway instead of just returning -EINVAL?  But the
new code is also buggy and not consistent with itself.

In the original code if the user data is "-1k" or "-1024" that was
treated the same.  In the new code, "-1k" means negative 1024 because
the user supplies units but "-1024" means positive 1024 because there
are no units given.

> > >  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.
> >
> > I think you are confusing lprocfs_write_frac_helper() and
> > lprocfs_write_frac_u64_helper().  There is only one caller for this
> > function.
> 
> By this logic, lprocfs_write_frac_u64_helper() should just be removed
> and it's code should be folded into lprocfs_write_u64_helper(), no?
> 

There are vast swathes of lustre code which need to be deleted but I
haven't looked at this one.  Probably.

regards,
dan carpenter

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