All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tristan Lelong <tristan@lelong.xyz>
To: "Dilger, Andreas" <andreas.dilger@intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	"Drokin, Oleg" <oleg.drokin@intel.com>,
	"askb23@gmail.com" <askb23@gmail.com>,
	"Hammond, John" <john.hammond@intel.com>,
	"gdonald@gmail.com" <gdonald@gmail.com>,
	"anhlq2110@gmail.com" <anhlq2110@gmail.com>,
	"fabio.falzoi84@gmail.com" <fabio.falzoi84@gmail.com>,
	"oort10@gmail.com" <oort10@gmail.com>,
	"agimenez@sysvalve.es" <agimenez@sysvalve.es>,
	"rupran@einserver.de" <rupran@einserver.de>,
	"surya.seetharaman9@gmail.com" <surya.seetharaman9@gmail.com>,
	"Julia.Lawall@lip6.fr" <Julia.Lawall@lip6.fr>,
	"joe@perches.com" <joe@perches.com>,
	"a.terekhov@gmail.com" <a.terekhov@gmail.com>,
	"vthakkar1994@gmail.com" <vthakkar1994@gmail.com>,
	"amk@cray.com" <amk@cray.com>,
	"srikrishanmalik@gmail.com" <srikrishanmalik@gmail.com>,
	"rd@radekdostal.com" <rd@radekdostal.com>,
	"bergwolf@gmail.com" <bergwolf@gmail.com>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"Gortmaker, Paul (Wind River)" <paul.gortmaker@windriver.com>,
	"tapaswenipathak@gmail.com" <tapaswenipathak@gmail.com>,
	"email@christophjaeger.info" <email@christophjaeger.info>,
	"uja.ornl@gmail.com" <uja.ornl@gmail.com>,
	"brilliantov@inbox.ru" <brilliantov@inbox.ru>,
	"Eremin, Dmitry" <dmitry.eremin@intel.com>,
	"HPDD-discuss@lists.01.org" <HPDD-discuss@ml01.01.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
Date: Sat, 6 Dec 2014 14:34:29 -0800	[thread overview]
Message-ID: <20141206223429.GA17675@dunderer> (raw)
In-Reply-To: <D0A87E89.CDFB9%andreas.dilger@intel.com>

Andreas,

On Sat, Dec 06, 2014 at 05:05:14PM +0000, Dilger, Andreas wrote:
> On 2014/12/05, 3:41 PM, "Tristan Lelong" <tristan@lelong.xyz> wrote:
> 
> 
> Sorry, but I don't see where you get 80 from?  fh_name is declared as a
> "const char *", and initialized in the declaration of fld_hash[].  I'd
> thought to reply that sizeof(fh_name) would even be better than a #define,
> but sizeof(const char *) doesn't actually make sense.
> 

You are right, I got confused with the names trying to follow the declaration of the variable.

> The longest declared fh_name is 4 characters, but I'm not sure of an easy
> way to determine this at compile time.  I guess one option is to change
> the declaration of struct lu_fld_hash to use "const char fh_name[4];" and
> then use sizeof(fh_name), but I don't know if that is better than just
> declaring a small buffer (8 chars) for this usage.  IMHO that is small
> enough to fit on the stack, since it is at the top of a very short
> callchain (userspace->sys_write->vfs_write->fld_proc_hash_seq_write())
> that just saves the value so the chance of stack overflow is basically nil.
> 

I can implement any of those 2 options. If somebody as a strong preference, let me know,
otherwise I'll follow Andreas idea and will redo the patch with a stack name variable of size 8.

> 
> Cheers, Andreas
> -- 
> Andreas Dilger
> 
> Lustre Software Architect
> Intel High Performance Data Division
> 
> 

Thanks for your comment and help.

      reply	other threads:[~2014-12-06 22:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  8:03 [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros Tristan Lelong
2014-12-05  8:28 ` Joe Perches
2014-12-05  8:37   ` Tristan Lelong
2014-12-05  8:44     ` Joe Perches
2014-12-05 22:35       ` Tristan Lelong
2014-12-05 21:27 ` Greg KH
2014-12-05 22:41   ` Tristan Lelong
2014-12-06 17:05     ` Dilger, Andreas
2014-12-06 22:34       ` Tristan Lelong [this message]

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=20141206223429.GA17675@dunderer \
    --to=tristan@lelong.xyz \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=a.terekhov@gmail.com \
    --cc=agimenez@sysvalve.es \
    --cc=amk@cray.com \
    --cc=andreas.dilger@intel.com \
    --cc=anhlq2110@gmail.com \
    --cc=askb23@gmail.com \
    --cc=bergwolf@gmail.com \
    --cc=brilliantov@inbox.ru \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dmitry.eremin@intel.com \
    --cc=email@christophjaeger.info \
    --cc=fabio.falzoi84@gmail.com \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=john.hammond@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    --cc=oort10@gmail.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=rd@radekdostal.com \
    --cc=rupran@einserver.de \
    --cc=srikrishanmalik@gmail.com \
    --cc=surya.seetharaman9@gmail.com \
    --cc=tapaswenipathak@gmail.com \
    --cc=uja.ornl@gmail.com \
    --cc=vthakkar1994@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.