All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset
@ 2021-06-02  1:17 Xiao Ni
  2021-06-21  1:10 ` Xiao Ni
  2021-07-16 14:22 ` Jes Sorensen
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Ni @ 2021-06-02  1:17 UTC (permalink / raw)
  To: jes; +Cc: ncroxon, linux-raid

For super1.0 bitmap offset is -16. So it needs to use int type for bitmap offset.

Fixes: 1fe2e1007310 (mdadm/bitmap: locate bitmap calcuate bitmap position wrongly)
Signed-off-by: Xiao Ni <xni@redhat.com>
---
 super1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/super1.c b/super1.c
index c05e623..a12a5bc 100644
--- a/super1.c
+++ b/super1.c
@@ -2631,7 +2631,7 @@ static int locate_bitmap1(struct supertype *st, int fd, int node_num)
 	else
 		ret = -1;
 
-	offset = __le64_to_cpu(sb->super_offset) + __le32_to_cpu(sb->bitmap_offset);
+	offset = __le64_to_cpu(sb->super_offset) + (int32_t)__le32_to_cpu(sb->bitmap_offset);
 	if (node_num) {
 		bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE);
 		bm_sectors_per_node = calc_bitmap_size(bms, 4096) >> 9;
-- 
2.7.5


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

* Re: [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset
  2021-06-02  1:17 [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset Xiao Ni
@ 2021-06-21  1:10 ` Xiao Ni
  2021-07-16 14:22 ` Jes Sorensen
  1 sibling, 0 replies; 3+ messages in thread
From: Xiao Ni @ 2021-06-21  1:10 UTC (permalink / raw)
  To: jes; +Cc: Nigel Croxon, linux-raid

Hi Jes

Ping, is the patch ok for you to merge it

Regards
Xiao

On Wed, Jun 2, 2021 at 9:17 AM Xiao Ni <xni@redhat.com> wrote:
>
> For super1.0 bitmap offset is -16. So it needs to use int type for bitmap offset.
>
> Fixes: 1fe2e1007310 (mdadm/bitmap: locate bitmap calcuate bitmap position wrongly)
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
>  super1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/super1.c b/super1.c
> index c05e623..a12a5bc 100644
> --- a/super1.c
> +++ b/super1.c
> @@ -2631,7 +2631,7 @@ static int locate_bitmap1(struct supertype *st, int fd, int node_num)
>         else
>                 ret = -1;
>
> -       offset = __le64_to_cpu(sb->super_offset) + __le32_to_cpu(sb->bitmap_offset);
> +       offset = __le64_to_cpu(sb->super_offset) + (int32_t)__le32_to_cpu(sb->bitmap_offset);
>         if (node_num) {
>                 bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE);
>                 bm_sectors_per_node = calc_bitmap_size(bms, 4096) >> 9;
> --
> 2.7.5
>


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

* Re: [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset
  2021-06-02  1:17 [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset Xiao Ni
  2021-06-21  1:10 ` Xiao Ni
@ 2021-07-16 14:22 ` Jes Sorensen
  1 sibling, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2021-07-16 14:22 UTC (permalink / raw)
  To: Xiao Ni; +Cc: ncroxon, linux-raid

On 6/1/21 9:17 PM, Xiao Ni wrote:
> For super1.0 bitmap offset is -16. So it needs to use int type for bitmap offset.
> 
> Fixes: 1fe2e1007310 (mdadm/bitmap: locate bitmap calcuate bitmap position wrongly)
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
>  super1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!

Jes

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

end of thread, other threads:[~2021-07-16 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  1:17 [PATCH 1/1] mdadm/super1: It needs to specify int32 for bitmap_offset Xiao Ni
2021-06-21  1:10 ` Xiao Ni
2021-07-16 14:22 ` Jes Sorensen

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.