Skip to content
This repository has been archived by the owner on Dec 29, 2017. It is now read-only.

Commit

Permalink
nbd: fix 64-bit division
Browse files Browse the repository at this point in the history
commit e88f72c upstream.

We have this:

ERROR: "__aeabi_ldivmod" [drivers/block/nbd.ko] undefined!
ERROR: "__divdi3" [drivers/block/nbd.ko] undefined!
nbd.c:(.text+0x247c72): undefined reference to `__divdi3'

due to a recent commit, that did 64-bit division. Use the proper
divider function so that 32-bit compiles don't break.

Fixes: ef77b51 ("nbd: use loff_t for blocksize and nbd_set_size args")
Signed-off-by: Jens Axboe <[email protected]>
Cc: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
axboe authored and gregkh committed Apr 21, 2017
1 parent 7599166 commit 25640e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,

case NBD_SET_SIZE:
return nbd_size_set(nbd, bdev, nbd->blksize,
arg / nbd->blksize);
div_s64(arg, nbd->blksize));

case NBD_SET_SIZE_BLOCKS:
return nbd_size_set(nbd, bdev, nbd->blksize, arg);
Expand Down

0 comments on commit 25640e7

Please sign in to comment.