summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2011-08-19 09:30:34 -0400
committerJosh Boyer <jwboyer@redhat.com>2011-08-19 09:30:34 -0400
commit7aac3ebb1e0cc675b2cbc54fcc1f98dd73c011b9 (patch)
tree4b73c74ef34c653c848e153f453ce46e68926498
parentc3c2b77d29fe2057cb4647f2810b6415ff55fadb (diff)
downloadkernel-7aac3ebb1e0cc675b2cbc54fcc1f98dd73c011b9.tar.gz
kernel-7aac3ebb1e0cc675b2cbc54fcc1f98dd73c011b9.tar.xz
kernel-7aac3ebb1e0cc675b2cbc54fcc1f98dd73c011b9.zip
Fix 64-bit divide error in btrfs
-rw-r--r--btrfs-use-do_div.patch38
-rw-r--r--kernel.spec7
2 files changed, 44 insertions, 1 deletions
diff --git a/btrfs-use-do_div.patch b/btrfs-use-do_div.patch
new file mode 100644
index 000000000..e32907ddb
--- /dev/null
+++ b/btrfs-use-do_div.patch
@@ -0,0 +1,38 @@
+From: Liu Bo <liubo2009 <at> cn.fujitsu.com>
+Subject: [PATCH] Btrfs: use do_div to avoid compile errors on 32bit box
+Date: 2011-08-19 09:48:44 GMT (3 hours and 36 minutes ago)
+
+When doing div operation of u64 type, we need to be careful and use do_div
+to avoid compile ERROR on 32bit box:
+
+"ERROR: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
+make[1]: *** [__modpost] Error 1
+
+Signed-off-by: Liu Bo <liubo2009 <at> cn.fujitsu.com>
+---
+ fs/btrfs/extent-tree.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
+index 80d6148..9b495ce 100644
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -6796,14 +6796,14 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
+ index = get_block_group_index(block_group);
+ if (index == 0) {
+ dev_min = 4;
+- min_free /= 2;
++ do_div(min_free, 2);
+ } else if (index == 1) {
+ dev_min = 2;
+ } else if (index == 2) {
+ min_free *= 2;
+ } else if (index == 3) {
+ dev_min = fs_devices->rw_devices;
+- min_free /= dev_min;
++ do_div(min_free, dev_min);
+ }
+
+ mutex_lock(&root->fs_info->chunk_mutex);
+--
+1.6.5.2
diff --git a/kernel.spec b/kernel.spec
index 873c15f3a..4d4ed2645 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -51,7 +51,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be prepended with "0.", so
# for example a 3 here will become 0.3
#
-%global baserelease 0
+%global baserelease 1
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -720,6 +720,7 @@ Patch12026: block-stray-block-put-after-teardown.patch
Patch12027: usb-add-quirk-for-logitech-webcams.patch
Patch12028: fix-perf-build.patch
Patch12029: crypto-register-cryptd-first.patch
+Patch12030: btrfs-use-do_div.patch
# Runtime power management
@@ -1347,6 +1348,7 @@ ApplyPatch usb-add-quirk-for-logitech-webcams.patch
ApplyPatch fix-perf-build.patch
ApplyPatch crypto-register-cryptd-first.patch
+ApplyPatch btrfs-use-do_div.patch
# Runtime PM
#ApplyPatch linux-2.6-usb-pci-autosuspend.patch
@@ -2073,6 +2075,9 @@ fi
# || ||
%changelog
* Fri Aug 19 2011 Josh Boyer <jwboyer@redhat.com>
+- Add patch from upstream to fix 64-bit divide error in btrfs
+
+* Fri Aug 19 2011 Josh Boyer <jwboyer@redhat.com>
- Linux 3.1-rc2-git5
- Change XHCI to builtin (rhbz 731706)
- Add patch to fix race between cryptd and aesni (rhbz 721002)