From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Jes Sorensen <jsorensen@fb.com>,
linux-raid@vger.kernel.org, Song Liu <song@kernel.org>,
dm-devel@redhat.com, Guoqing Jiang <guoqing.jiang@linux.dev>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: [dm-devel] [PATCH] mdadm: fix compilation failure on the x32 ABI
Date: Thu, 17 Nov 2022 15:28:43 +0100 [thread overview]
Message-ID: <20221117152843.00002f30@linux.intel.com> (raw)
In-Reply-To: <alpine.LRH.2.21.2211040957470.19553@file01.intranet.prod.int.rdu2.redhat.com>
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
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
WARNING: multiple messages have this Message-ID (diff)
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: NeilBrown <neilb@suse.de>, Jes Sorensen <jsorensen@fb.com>,
Song Liu <song@kernel.org>,
Guoqing Jiang <guoqing.jiang@linux.dev>,
Zdenek Kabelac <zkabelac@redhat.com>,
linux-raid@vger.kernel.org, dm-devel@redhat.com
Subject: Re: [PATCH] mdadm: fix compilation failure on the x32 ABI
Date: Thu, 17 Nov 2022 15:28:43 +0100 [thread overview]
Message-ID: <20221117152843.00002f30@linux.intel.com> (raw)
In-Reply-To: <alpine.LRH.2.21.2211040957470.19553@file01.intranet.prod.int.rdu2.redhat.com>
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
next prev parent reply other threads:[~2022-11-18 8:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 14:01 [dm-devel] [PATCH] mdadm: fix compilation failure on the x32 ABI Mikulas Patocka
2022-11-04 14:01 ` Mikulas Patocka
2022-11-17 14:28 ` Mariusz Tkaczyk [this message]
2022-11-17 14:28 ` Mariusz Tkaczyk
2022-11-17 14:51 ` [dm-devel] " Jes Sorensen
2022-11-17 14:51 ` Jes Sorensen
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=20221117152843.00002f30@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=dm-devel@redhat.com \
--cc=guoqing.jiang@linux.dev \
--cc=jsorensen@fb.com \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=song@kernel.org \
--cc=zkabelac@redhat.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.