From 8880dabe6d2237f39fb7101c9249ccc805a1458d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 9 Apr 2013 09:12:11 -0700 Subject: [PATCH] 3.0-stable patches added patches: ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch --- ...-3.0-stable-backport-of-upstream-fix.patch | 53 +++++++++++++++++++ queue-3.0/series | 1 + 2 files changed, 54 insertions(+) create mode 100644 queue-3.0/ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch diff --git a/queue-3.0/ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch b/queue-3.0/ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch new file mode 100644 index 00000000000..c0b95c80c4f --- /dev/null +++ b/queue-3.0/ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch @@ -0,0 +1,53 @@ +From toddpoynor@google.com Tue Apr 9 09:08:53 2013 +From: Todd Poynor +Date: Fri, 5 Apr 2013 16:38:53 -0700 +Subject: ext4: fixup 64-bit divides in 3.0-stable backport of upstream fix +To: stable@vger.kernel.org +Message-ID: <1365205133-28456-1-git-send-email-toddpoynor@google.com> + +From: Todd Poynor + +Replace C division operators with div64_u64 for divides introduced in: +commit 503f4bdcc078e7abee273a85ce322de81b18a224 +ext4: use atomic64_t for the per-flexbg free_clusters count + +Specific to the 3.0-stable backport of the upstream patch. + +Signed-off-by: Todd Poynor +Reviewed-by: "Theodore Ts'o" +Cc: Christoph Biedl +Cc: Lukas Czerner +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/ialloc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/ext4/ialloc.c ++++ b/fs/ext4/ialloc.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + #include "ext4.h" +@@ -356,7 +357,7 @@ static int find_group_flex(struct super_ + + find_close_to_parent: + flexbg_free_blocks = atomic64_read(&flex_group[best_flex].free_blocks); +- flex_freeb_ratio = flexbg_free_blocks * 100 / blocks_per_flex; ++ flex_freeb_ratio = div64_u64(flexbg_free_blocks * 100, blocks_per_flex); + if (atomic_read(&flex_group[best_flex].free_inodes) && + flex_freeb_ratio > free_block_ratio) + goto found_flexbg; +@@ -371,7 +372,7 @@ find_close_to_parent: + continue; + + flexbg_free_blocks = atomic64_read(&flex_group[i].free_blocks); +- flex_freeb_ratio = flexbg_free_blocks * 100 / blocks_per_flex; ++ flex_freeb_ratio = div64_u64(flexbg_free_blocks * 100, blocks_per_flex); + + if (flex_freeb_ratio > free_block_ratio && + (atomic_read(&flex_group[i].free_inodes))) { diff --git a/queue-3.0/series b/queue-3.0/series index fc929c6ee2b..3c8ad817e9f 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -3,3 +3,4 @@ ubifs-make-space-fixup-work-in-the-remount-case.patch reiserfs-fix-warning-and-inode-leak-when-deleting-inode-with-xattrs.patch alsa-hda-bug-fix-on-return-value-when-getting-hdmi-eld-info.patch alsa-hda-fix-typo-in-proc-output.patch +ext4-fixup-64-bit-divides-in-3.0-stable-backport-of-upstream-fix.patch -- 2.47.3