public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] trace-cmd: fix writing of uncompressed size
@ 2022-07-11  9:43 Sven Schnelle
  2022-07-11  9:46 ` Tzvetomir Stoyanov
  2022-07-11 17:51 ` Steven Rostedt
  0 siblings, 2 replies; 5+ messages in thread
From: Sven Schnelle @ 2022-07-11  9:43 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Tzvetomir Stoyanov, linux-s390

pointer in struct tracecmd_compression is 'unsigned long', which is 8 byte
in size on most platforms, but the tep_read_number() call in the next line
treats it as a 4 byte value. As there's no need for unsigned long change
the type to unsigned int.

Fixes: 3f8447b1 ("trace-cmd library: Add support for compression algorithms")
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
 lib/trace-cmd/trace-compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c
index a63295e..461de8d 100644
--- a/lib/trace-cmd/trace-compress.c
+++ b/lib/trace-cmd/trace-compress.c
@@ -32,7 +32,7 @@ struct tracecmd_compression {
 	int				fd;
 	unsigned int			capacity;
 	unsigned int			capacity_read;
-	unsigned long			pointer;
+	unsigned int			pointer;
 	char				*buffer;
 	struct compress_proto		*proto;
 	struct tep_handle		*tep;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] trace-cmd: fix writing of uncompressed size
  2022-07-11  9:43 [PATCH v2] trace-cmd: fix writing of uncompressed size Sven Schnelle
@ 2022-07-11  9:46 ` Tzvetomir Stoyanov
  2022-07-11 17:51 ` Steven Rostedt
  1 sibling, 0 replies; 5+ messages in thread
From: Tzvetomir Stoyanov @ 2022-07-11  9:46 UTC (permalink / raw)
  To: Sven Schnelle; +Cc: Steven Rostedt, linux-s390

On Mon, Jul 11, 2022 at 12:43 PM Sven Schnelle <svens@linux.ibm.com> wrote:
>
> pointer in struct tracecmd_compression is 'unsigned long', which is 8 byte
> in size on most platforms, but the tep_read_number() call in the next line
> treats it as a 4 byte value. As there's no need for unsigned long change
> the type to unsigned int.
>
> Fixes: 3f8447b1 ("trace-cmd library: Add support for compression algorithms")
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>

Acked-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>

Thanks!

> ---
>  lib/trace-cmd/trace-compress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c
> index a63295e..461de8d 100644
> --- a/lib/trace-cmd/trace-compress.c
> +++ b/lib/trace-cmd/trace-compress.c
> @@ -32,7 +32,7 @@ struct tracecmd_compression {
>         int                             fd;
>         unsigned int                    capacity;
>         unsigned int                    capacity_read;
> -       unsigned long                   pointer;
> +       unsigned int                    pointer;
>         char                            *buffer;
>         struct compress_proto           *proto;
>         struct tep_handle               *tep;
> --
> 2.36.1
>


-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] trace-cmd: fix writing of uncompressed size
  2022-07-11  9:43 [PATCH v2] trace-cmd: fix writing of uncompressed size Sven Schnelle
  2022-07-11  9:46 ` Tzvetomir Stoyanov
@ 2022-07-11 17:51 ` Steven Rostedt
  2022-07-11 18:15   ` Steven Rostedt
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2022-07-11 17:51 UTC (permalink / raw)
  To: Sven Schnelle; +Cc: Tzvetomir Stoyanov, linux-s390

On Mon, 11 Jul 2022 11:43:40 +0200
Sven Schnelle <svens@linux.ibm.com> wrote:

> pointer in struct tracecmd_compression is 'unsigned long', which is 8 byte
> in size on most platforms, but the tep_read_number() call in the next line
> treats it as a 4 byte value. As there's no need for unsigned long change
> the type to unsigned int.
> 
> Fixes: 3f8447b1 ("trace-cmd library: Add support for compression algorithms")
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>

Hi Sven,

Can you resend and Cc linux-trace-devel@vger.kernel.org so that it gets
added to patchwork.

Thanks!

-- Steve


> ---
>  lib/trace-cmd/trace-compress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c
> index a63295e..461de8d 100644
> --- a/lib/trace-cmd/trace-compress.c
> +++ b/lib/trace-cmd/trace-compress.c
> @@ -32,7 +32,7 @@ struct tracecmd_compression {
>  	int				fd;
>  	unsigned int			capacity;
>  	unsigned int			capacity_read;
> -	unsigned long			pointer;
> +	unsigned int			pointer;
>  	char				*buffer;
>  	struct compress_proto		*proto;
>  	struct tep_handle		*tep;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] trace-cmd: fix writing of uncompressed size
  2022-07-11 17:51 ` Steven Rostedt
@ 2022-07-11 18:15   ` Steven Rostedt
  2022-07-12  5:31     ` Sven Schnelle
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2022-07-11 18:15 UTC (permalink / raw)
  To: Sven Schnelle; +Cc: Tzvetomir Stoyanov, linux-s390

On Mon, 11 Jul 2022 13:51:46 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Can you resend and Cc linux-trace-devel@vger.kernel.org so that it gets
> added to patchwork.

Actually, I'll just send it for you ;-)

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] trace-cmd: fix writing of uncompressed size
  2022-07-11 18:15   ` Steven Rostedt
@ 2022-07-12  5:31     ` Sven Schnelle
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Schnelle @ 2022-07-12  5:31 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Tzvetomir Stoyanov, linux-s390

Hi Steve,

Steven Rostedt <rostedt@goodmis.org> writes:

> On Mon, 11 Jul 2022 13:51:46 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
>> Can you resend and Cc linux-trace-devel@vger.kernel.org so that it gets
>> added to patchwork.
>
> Actually, I'll just send it for you ;-)

Thank you! :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-12  5:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-11  9:43 [PATCH v2] trace-cmd: fix writing of uncompressed size Sven Schnelle
2022-07-11  9:46 ` Tzvetomir Stoyanov
2022-07-11 17:51 ` Steven Rostedt
2022-07-11 18:15   ` Steven Rostedt
2022-07-12  5:31     ` Sven Schnelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox