Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] [LTTNG-MODULES PATCH] copy_from_user and memset
Date: Tue, 27 Sep 2011 07:46:48 -0400	[thread overview]
Message-ID: <20110927114647.GA3205@Krystal> (raw)
In-Reply-To: <20110927011324.GD15747@Krystal>

* Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> * Julien Desfossez (julien.desfossez at polymtl.ca) wrote:
> > This patch provides the copy_from_user and memset operations for the lib
> > ringbuffer.
> > 
> > Signed-off-by: Julien Desfossez <julien.desfossez at polymtl.ca>
[...]
> > +#undef tp_copy_string_from_user
> > +#define tp_copy_string_from_user(dest, src, len)			\
> > +	__assign_##dest:						\
> > +	if (0)								\
> > +		(void) __typemap.dest;					\
> > +	lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest));	\
> > +	__chan->ops->event_write_from_user(&__ctx, src, len - 1);	\
> 
> Hrm, thinking about it, it would make sense to have the caller to:
> 
> somelen assigned from   strlen(input);
> 
> tp_copy_string_from_user(dest, src, somelen)
> 
> So the "len - 1" here could be turned into "len", but we should comment
> that tp_copy_string_from_user takes the length without the \0, and that
> we implicitly add the \0. Makes sense ?

Hi Julien,

I did the modifications and merged your patch, thanks!

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



  reply	other threads:[~2011-09-27 11:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 19:39 Julien Desfossez
2011-09-27  1:13 ` Mathieu Desnoyers
2011-09-27 11:46   ` Mathieu Desnoyers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-17 18:44 Julien Desfossez

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=20110927114647.GA3205@Krystal \
    --to=compudj@krystal.dyndns.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