lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Apr 2012 15:34:48 +1000
From:	Stephen Rothwell <sfr@...b.auug.org.au>
To:	Neil Brown <neilb@...e.de>
Cc:	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: linux-next: build failure after merge of the final tree (md tree
 related)

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@...b.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@...b.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@...b.auug.org.au
http://www.canb.auug.org.au/~sfr/

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ