From: Alexei Starovoitov <ast@plumgrid.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Ingo Molnar <mingo@kernel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Wang Nan <wangnan0@huawei.com>, He Kuang <hekuang@huawei.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Brendan Gregg <brendan.d.gregg@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()
Date: Fri, 28 Aug 2015 15:08:35 -0700 [thread overview]
Message-ID: <55E0DBE3.8010504@plumgrid.com> (raw)
In-Reply-To: <20150828174813.23e6e78b@gandalf.local.home>
On 8/28/15 2:48 PM, Steven Rostedt wrote:
>> * On success, returns the length of the string (not including the trailing
>> >+ * NUL).
> I think it includes the NUL.
oops. yes. that was a copy paste from strncpy_from_user comment.
trace_kprobe usage wants NUL to be counted, so I intended to have it
counted, but that brings the question what should be the semantics.
Should it be similar to strncpy_from_user (not counting NUL) or
similar to strlen_user (counts NUL) ?
imo counting NUL makes a little bit more sense, since when a user says
strncpy_from_unsafe(..., ..., 32)
and it returns 32 as the whole buffer was filled, it looks cleaner.
Thoughts?
next prev parent reply other threads:[~2015-08-28 22:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 19:51 [PATCH v2 net-next 0/2] support for '%s' in bpf_trace_printk Alexei Starovoitov
2015-08-28 19:51 ` [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe() Alexei Starovoitov
2015-08-28 21:48 ` Steven Rostedt
2015-08-28 22:08 ` Alexei Starovoitov [this message]
2015-08-28 22:11 ` Steven Rostedt
2015-08-28 22:13 ` Alexei Starovoitov
2015-08-28 19:51 ` [PATCH v2 net-next 2/2] bpf: add support for %s specifier to bpf_trace_printk() Alexei Starovoitov
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=55E0DBE3.8010504@plumgrid.com \
--to=ast@plumgrid.com \
--cc=brendan.d.gregg@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hekuang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=wangnan0@huawei.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.