All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree (md tree related)
@ 2012-04-20  5:34 Stephen Rothwell
  2012-04-23  0:18 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2012-04-20  5:34 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3102 bytes --]

Hi Neil,

After merging the final tree, today's linux-next build (i386 defconfig)
failed like this:

drivers/built-in.o: In function `bitmap_resize':
(.text+0x202b76): undefined reference to `__udivdi3'
drivers/built-in.o: In function `bitmap_resize':
(.text+0x202bac): undefined reference to `__udivdi3'

Caused by commit 6c5cb1922cca ("md/bitmap: add bitmap_resize function to
allow bitmap resizing").

I also get these warnings:

drivers/md/bitmap.c: In function 'bitmap_resize':
drivers/md/bitmap.c:1878:11: warning: comparison of distinct pointer types lacks a cast [enabled by default]
drivers/md/bitmap.c:1887:11: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'
drivers/md/bitmap.c:1892:12: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'
drivers/md/bitmap.c:1920:8: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'

I applied the patch below for the link failure, but the above warnings
should be addressed as well.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 20 Apr 2012 15:26:52 +1000
Subject: [PATCH] md/bitmap: use DIV_ROUND_UP_SECTOR_T

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/md/bitmap.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 47d5c8d..a780407 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1828,15 +1828,15 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
 		do {
 			/* 'chunkshift' is shift from block size to chunk size */
 			chunkshift++;
-			chunks = DIV_ROUND_UP(blocks, 1 << chunkshift);
-			bytes = DIV_ROUND_UP(chunks, 8);
+			chunks = DIV_ROUND_UP_SECTOR_T(blocks, 1 << chunkshift);
+			bytes = DIV_ROUND_UP_SECTOR_T(chunks, 8);
 			if (!bitmap->mddev->bitmap_info.external)
 				bytes += sizeof(bitmap_super_t);
 		} while (bytes > (space << 9));
 	} else
 		chunkshift = ffz(~chunksize) - BITMAP_BLOCK_SHIFT;
 
-	chunks = DIV_ROUND_UP(blocks, 1 << chunkshift);
+	chunks = DIV_ROUND_UP_SECTOR_T(blocks, 1 << chunkshift);
 	memset(&store, 0, sizeof(store));
 	if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
 		ret = bitmap_storage_alloc(&store, chunks,
@@ -1844,7 +1844,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
 	if (ret)
 		goto err;
 
-	pages = DIV_ROUND_UP(chunks, PAGE_COUNTER_RATIO);
+	pages = DIV_ROUND_UP_SECTOR_T(chunks, PAGE_COUNTER_RATIO);
 
 	new_bp = kzalloc(pages * sizeof(*new_bp), GFP_KERNEL);
 	ret = -ENOMEM;
-- 
1.7.10.rc3

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: build failure after merge of the final tree (md tree related)
  2012-04-20  5:34 linux-next: build failure after merge of the final tree (md tree related) Stephen Rothwell
@ 2012-04-23  0:18 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-04-23  0:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

On Fri, 20 Apr 2012 15:34:48 +1000 Stephen Rothwell <sfr@canb.auug.org.au>
wrote:

> Hi Neil,
> 
> After merging the final tree, today's linux-next build (i386 defconfig)
> failed like this:
> 
> drivers/built-in.o: In function `bitmap_resize':
> (.text+0x202b76): undefined reference to `__udivdi3'
> drivers/built-in.o: In function `bitmap_resize':
> (.text+0x202bac): undefined reference to `__udivdi3'
> 
> Caused by commit 6c5cb1922cca ("md/bitmap: add bitmap_resize function to
> allow bitmap resizing").
> 
> I also get these warnings:
> 
> drivers/md/bitmap.c: In function 'bitmap_resize':
> drivers/md/bitmap.c:1878:11: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> drivers/md/bitmap.c:1887:11: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
> drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'
> drivers/md/bitmap.c:1892:12: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
> drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'
> drivers/md/bitmap.c:1920:8: warning: passing argument 3 of 'bitmap_get_counter' from incompatible pointer type [enabled by default]
> drivers/md/bitmap.c:1225:26: note: expected 'sector_t *' but argument is of type 'long int *'
> 
> I applied the patch below for the link failure, but the above warnings
> should be addressed as well.

Thanks Stephen.  I've fixed all that up now - and done a test 32-bit
compile :-)

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-04-23  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20  5:34 linux-next: build failure after merge of the final tree (md tree related) Stephen Rothwell
2012-04-23  0:18 ` NeilBrown

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.