All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Chris Rorvick <chris@rorvick.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"Drokin, Oleg" <oleg.drokin@intel.com>,
	"Dilger, Andreas" <andreas.dilger@intel.com>,
	Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	James Simmons <uja.ornl@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Greg Donald <gdonald@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Fabian Frederick <fabf@skynet.be>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Andriy Skulysh <Andriy_Skulysh@xyratex.com>,
	"HPDD-discuss@ml01.01.org" <HPDD-discuss@ml01.01.org>,
	"Hammond, John" <john.hammond@intel.com>
Subject: Re: [PATCH] drivers: staging: lustre: Use mult if units not specified
Date: Tue, 16 Dec 2014 16:54:59 +0300	[thread overview]
Message-ID: <20141216135459.GJ4856@mwanda> (raw)
In-Reply-To: <CAEUsAPYTBq+0DGG909Rn0JhpF5Rh_6KbvmxS0wPQJ3j+qgZrEQ@mail.gmail.com>

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@oracle.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


  reply	other threads:[~2014-12-16 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  5:41 [PATCH] drivers: staging: lustre: Use mult if units not specified Chris Rorvick
2014-12-16  9:41 ` Dan Carpenter
2014-12-16 11:14   ` Dilger, Andreas
2014-12-16 11:35     ` Dan Carpenter
2014-12-16 12:53       ` Chris Rorvick
2014-12-16 13:54         ` Dan Carpenter [this message]
2014-12-16 14:04           ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141216135459.GJ4856@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Andriy_Skulysh@xyratex.com \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=andreas.dilger@intel.com \
    --cc=chris@rorvick.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fabf@skynet.be \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.hammond@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=uja.ornl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.