linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm: fix compilation failure on the x32 ABI
@ 2022-11-04 14:01 Mikulas Patocka
  2022-11-17 14:28 ` Mariusz Tkaczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Mikulas Patocka @ 2022-11-04 14:01 UTC (permalink / raw)
  To: NeilBrown, Jes Sorensen
  Cc: Song Liu, Guoqing Jiang, Zdenek Kabelac, linux-raid, dm-devel

Hi

Here I'm sending a patch for the mdadm utility. It fixes compile failure 
on the x32 ABI.

Mikulas


From: Mikulas Patocka <mpatocka@redhat.com>

The x32 ABI has 32-bit long and 64-bit time_t. Consequently, it reports 
printf arguments mismatch when attempting to print time using the "%ld" 
format specifier.

Fix this by converting times to long long and using %lld when printing
them.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 monitor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: mdadm/monitor.c
===================================================================
--- mdadm.orig/monitor.c	2022-11-04 14:25:52.000000000 +0100
+++ mdadm/monitor.c	2022-11-04 14:28:05.000000000 +0100
@@ -449,9 +449,9 @@ static int read_and_act(struct active_ar
 	}
 
 	gettimeofday(&tv, NULL);
-	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
 		a->info.container_member,
-		tv.tv_sec, tv.tv_usec,
+		(long long)tv.tv_sec, (long long)tv.tv_usec,
 		array_states[a->curr_state],
 		array_states[a->prev_state],
 		sync_actions[a->curr_action],


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

* Re: [PATCH] mdadm: fix compilation failure on the x32 ABI
  2022-11-04 14:01 [PATCH] mdadm: fix compilation failure on the x32 ABI Mikulas Patocka
@ 2022-11-17 14:28 ` Mariusz Tkaczyk
  2022-11-17 14:51   ` Jes Sorensen
  0 siblings, 1 reply; 3+ messages in thread
From: Mariusz Tkaczyk @ 2022-11-17 14:28 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: NeilBrown, Jes Sorensen, Song Liu, Guoqing Jiang, Zdenek Kabelac,
	linux-raid, dm-devel

On Fri, 4 Nov 2022 10:01:22 -0400 (EDT)
Mikulas Patocka <mpatocka@redhat.com> wrote:

> Hi
> 
> Here I'm sending a patch for the mdadm utility. It fixes compile failure 
> on the x32 ABI.
> 
> Mikulas
> 
> 
> From: Mikulas Patocka <mpatocka@redhat.com>
> 
> The x32 ABI has 32-bit long and 64-bit time_t. Consequently, it reports 
> printf arguments mismatch when attempting to print time using the "%ld" 
> format specifier.
> 
> Fix this by converting times to long long and using %lld when printing
> them.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  monitor.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: mdadm/monitor.c
> ===================================================================
> --- mdadm.orig/monitor.c	2022-11-04 14:25:52.000000000 +0100
> +++ mdadm/monitor.c	2022-11-04 14:28:05.000000000 +0100
> @@ -449,9 +449,9 @@ static int read_and_act(struct active_ar
>  	}
>  
>  	gettimeofday(&tv, NULL);
> -	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s
> start:%llu\n",
> +	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s
> start:%llu\n", a->info.container_member,
> -		tv.tv_sec, tv.tv_usec,
> +		(long long)tv.tv_sec, (long long)tv.tv_usec,
>  		array_states[a->curr_state],
>  		array_states[a->prev_state],
>  		sync_actions[a->curr_action],
> 
Hi Mikulas,
This is just a debug log in mdmon, feel free to remove the time totally.

Thanks,
Mariusz

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

* Re: [PATCH] mdadm: fix compilation failure on the x32 ABI
  2022-11-17 14:28 ` Mariusz Tkaczyk
@ 2022-11-17 14:51   ` Jes Sorensen
  0 siblings, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2022-11-17 14:51 UTC (permalink / raw)
  To: Mariusz Tkaczyk, Mikulas Patocka
  Cc: NeilBrown, Jes Sorensen, Song Liu, Guoqing Jiang, Zdenek Kabelac,
	linux-raid, dm-devel

On 11/17/22 09:28, Mariusz Tkaczyk wrote:
> On Fri, 4 Nov 2022 10:01:22 -0400 (EDT)
> Mikulas Patocka <mpatocka@redhat.com> wrote:
> 
>> Hi
>>
>> Here I'm sending a patch for the mdadm utility. It fixes compile failure 
>> on the x32 ABI.
>>
>> Mikulas
>>
>>
>> From: Mikulas Patocka <mpatocka@redhat.com>
>>
>> The x32 ABI has 32-bit long and 64-bit time_t. Consequently, it reports 
>> printf arguments mismatch when attempting to print time using the "%ld" 
>> format specifier.
>>
>> Fix this by converting times to long long and using %lld when printing
>> them.
>>
>> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>>
>> ---
>>  monitor.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> Index: mdadm/monitor.c
>> ===================================================================
>> --- mdadm.orig/monitor.c	2022-11-04 14:25:52.000000000 +0100
>> +++ mdadm/monitor.c	2022-11-04 14:28:05.000000000 +0100
>> @@ -449,9 +449,9 @@ static int read_and_act(struct active_ar
>>  	}
>>  
>>  	gettimeofday(&tv, NULL);
>> -	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s
>> start:%llu\n",
>> +	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s
>> start:%llu\n", a->info.container_member,
>> -		tv.tv_sec, tv.tv_usec,
>> +		(long long)tv.tv_sec, (long long)tv.tv_usec,
>>  		array_states[a->curr_state],
>>  		array_states[a->prev_state],
>>  		sync_actions[a->curr_action],
>>
> Hi Mikulas,
> This is just a debug log in mdmon, feel free to remove the time totally.

I second this! :)

Jes



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

end of thread, other threads:[~2022-11-17 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 14:01 [PATCH] mdadm: fix compilation failure on the x32 ABI Mikulas Patocka
2022-11-17 14:28 ` Mariusz Tkaczyk
2022-11-17 14:51   ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).