From: kernel test robot <lkp@intel.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Kent Overstreet <kent.overstreet@linux.dev>,
Dave Chinner <dchinner@redhat.com>
Subject: fs/xfs/./scrub/trace.h:748:3: warning: 'strncpy' specified bound 256 equals destination size
Date: Fri, 29 Mar 2024 05:06:49 +0800 [thread overview]
Message-ID: <202403290419.HPcyvqZu-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8d025e2092e29bfd13e56c78e22af25fac83c8ec
commit: 3934e8ebb7cc6e5f1ade35d586ed3eb79b88eb95 xfs: create a big array data structure
date: 8 months ago
config: x86_64-buildonly-randconfig-005-20240328 (https://download.01.org/0day-ci/archive/20240329/202403290419.HPcyvqZu-lkp@intel.com/config)
compiler: gcc-8 (Ubuntu 8.4.0-3ubuntu2) 8.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240329/202403290419.HPcyvqZu-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403290419.HPcyvqZu-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/trace/define_trace.h:103,
from fs/xfs/scrub/trace.h:1119,
from fs/xfs/scrub/trace.c:42:
fs/xfs/./scrub/trace.h: In function 'perf_trace_xfile_create':
>> fs/xfs/./scrub/trace.h:748:3: warning: 'strncpy' specified bound 256 equals destination size [-Wstringop-truncation]
strncpy(__entry->pathname, path, sizeof(__entry->pathname));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/perf.h:51:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:44:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
fs/xfs/./scrub/trace.h:731:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(xfile_create,
^~~~~~~~~~~
fs/xfs/./scrub/trace.h:739:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
In file included from include/trace/define_trace.h:102,
from fs/xfs/scrub/trace.h:1119,
from fs/xfs/scrub/trace.c:42:
fs/xfs/./scrub/trace.h: In function 'trace_event_raw_event_xfile_create':
>> fs/xfs/./scrub/trace.h:748:3: warning: 'strncpy' specified bound 256 equals destination size [-Wstringop-truncation]
strncpy(__entry->pathname, path, sizeof(__entry->pathname));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/trace_events.h:402:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:44:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
fs/xfs/./scrub/trace.h:731:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(xfile_create,
^~~~~~~~~~~
fs/xfs/./scrub/trace.h:739:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
vim +/strncpy +748 fs/xfs/./scrub/trace.h
730
731 TRACE_EVENT(xfile_create,
732 TP_PROTO(struct xfile *xf),
733 TP_ARGS(xf),
734 TP_STRUCT__entry(
735 __field(dev_t, dev)
736 __field(unsigned long, ino)
737 __array(char, pathname, 256)
738 ),
739 TP_fast_assign(
740 char pathname[257];
741 char *path;
742
743 __entry->ino = file_inode(xf->file)->i_ino;
744 memset(pathname, 0, sizeof(pathname));
745 path = file_path(xf->file, pathname, sizeof(pathname) - 1);
746 if (IS_ERR(path))
747 path = "(unknown)";
> 748 strncpy(__entry->pathname, path, sizeof(__entry->pathname));
749 ),
750 TP_printk("xfino 0x%lx path '%s'",
751 __entry->ino,
752 __entry->pathname)
753 );
754
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-28 21:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202403290419.HPcyvqZu-lkp@intel.com \
--to=lkp@intel.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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®