From 7a613e23af2bab74f976ff1f68d21847adffcd09 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Tue, 24 Jan 2017 21:35:14 +0900 Subject: [PATCH] nbd: fix 64-bit division --- debian/changelog | 1 + .../bugfix/all/nbd-fix-64-bit-division.patch | 33 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 35 insertions(+) create mode 100644 debian/patches/bugfix/all/nbd-fix-64-bit-division.patch diff --git a/debian/changelog b/debian/changelog index 2823c28ed..f0ac1b462 100644 --- a/debian/changelog +++ b/debian/changelog @@ -371,6 +371,7 @@ linux (4.9.5-1) UNRELEASED; urgency=medium * drivers/input: Enable TOUCHSCREEN_GOODIX as module (Closes: #851821). * [mips/octeon] hwmon: Enable SENSORS_ADM1031 as module (Closes: #851963). Thanks to James Cowgill. + * nbd: fix 64-bit division. -- Salvatore Bonaccorso Mon, 16 Jan 2017 09:26:13 +0100 diff --git a/debian/patches/bugfix/all/nbd-fix-64-bit-division.patch b/debian/patches/bugfix/all/nbd-fix-64-bit-division.patch new file mode 100644 index 000000000..96c1f0f39 --- /dev/null +++ b/debian/patches/bugfix/all/nbd-fix-64-bit-division.patch @@ -0,0 +1,33 @@ +From: Jens Axboe +Date: Sat, 3 Dec 2016 12:08:03 -0700 +Subject: [PATCH] nbd: fix 64-bit division +Origin: https://git.kernel.org/linus/e88f72cb9f54f6d244e55f629fe5e2f34ca6f9ed + +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: ef77b515243b ("nbd: use loff_t for blocksize and nbd_set_size args") +Signed-off-by: Jens Axboe +--- + drivers/block/nbd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c +index 92f5400edbd3..bc78cbb2d18a 100644 +--- a/drivers/block/nbd.c ++++ b/drivers/block/nbd.c +@@ -729,7 +729,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); diff --git a/debian/patches/series b/debian/patches/series index ea323b6e3..79657e6e4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -69,6 +69,7 @@ bugfix/all/mm-memcontrol-use-special-workqueue-for-creating-per-memcg-caches.pat bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch bugfix/all/nbd-use-loff_t-for-blocksize-and-nbd_set_size-args.patch bugfix/all/ath9k-fix-null-pointer-dereference.patch +bugfix/all/nbd-fix-64-bit-division.patch # Miscellaneous features