lkml.org 
[lkml]   [2012]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectlinux-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@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/
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2012-04-20 07:39    [W:0.038 / U:93.756 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site