From: Joe Perches <joe@perches.com>
To: Qian Cai <cai@lca.pw>, David Laight <David.Laight@ACULAB.COM>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "tobin@kernel.org" <tobin@kernel.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"tj@kernel.org" <tj@kernel.org>,
"dchinner@redhat.com" <dchinner@redhat.com>,
"fengguang.wu@intel.com" <fengguang.wu@intel.com>,
"jack@suse.cz" <jack@suse.cz>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] writeback: fix -Wstringop-truncation warnings
Date: Thu, 25 Jul 2019 09:41:00 -0700 [thread overview]
Message-ID: <2331c1248aceff966403c0f3c5d527c95c930b5b.camel@perches.com> (raw)
In-Reply-To: <1564069805.11067.20.camel@lca.pw>
On Thu, 2019-07-25 at 11:50 -0400, Qian Cai wrote:
> > > diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
[]
> > > @@ -66,8 +66,10 @@
> > > ),
> > >
> > > TP_fast_assign(
> > > - strncpy(__entry->name,
> > > - mapping ? dev_name(inode_to_bdi(mapping->host)-
> > > > dev) : "(unknown)", 32);
> > >
> > > + strscpy_pad(__entry->name,
> > > + mapping ?
> > > + dev_name(inode_to_bdi(mapping->host)->dev) :
> > > + "(unknown)", 32);
> >
> > Shouldn't the 32 be 'sizeof (something)' ??
>
> Maybe could do a sizeof(__entry->name) as it is defined as,
>
> TP_STRUCT__entry (
> __array(char, name, 32)
> __field(unsigned long, ino)
> __field(pgoff_t, index)
>
> But, that might be a follow-up patch and does not seem belong here.
stracpy_pad would work one day.
prev parent reply other threads:[~2019-07-25 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 14:38 Qian Cai
2019-07-25 15:04 ` David Laight
2019-07-25 15:50 ` Qian Cai
2019-07-25 16:41 ` Joe Perches [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=2331c1248aceff966403c0f3c5d527c95c930b5b.camel@perches.com \
--to=joe@perches.com \
--cc=David.Laight@ACULAB.COM \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cai@lca.pw \
--cc=dchinner@redhat.com \
--cc=fengguang.wu@intel.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=tobin@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®