[linux] 01/01: nbd: fix 64-bit division

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Jan 24 12:47:55 UTC 2017


This is an automated email from the git hooks/post-receive script.

rosh-guest pushed a commit to branch sid
in repository linux.

commit 7a613e23af2bab74f976ff1f68d21847adffcd09
Author: Roger Shimizu <rogershimizu at gmail.com>
Date:   Tue Jan 24 21:35:14 2017 +0900

    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(+)

diff --git a/debian/changelog b/debian/changelog
index 2823c28..f0ac1b4 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 <carnil at debian.org>  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 0000000..96c1f0f
--- /dev/null
+++ b/debian/patches/bugfix/all/nbd-fix-64-bit-division.patch
@@ -0,0 +1,33 @@
+From: Jens Axboe <axboe at fb.com>
+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 <axboe at fb.com>
+---
+ 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 ea323b6..79657e6 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
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list