From: Justin Maggard Date: Tue, 21 Jan 2014 19:18:29 +0000 (-0800) Subject: btrfs: fix defrag 32-bit integer overflow X-Git-Tag: v3.14-rc1~29^2~16 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c41570c9d29764f797fa35490d72b7395a0105c3;p=pandora-kernel.git btrfs: fix defrag 32-bit integer overflow When defragging a very large file, the cluster variable can wrap its 32-bit signed int type and become negative, which eventually gets passed to btrfs_force_ra() as a very large unsigned long value. On 32-bit platforms, this eventually results in an Oops from the SLAB allocator. Change the cluster and max_cluster signed int variables to unsigned long to match the readahead functions. This also allows the min() comparison in btrfs_defrag_file() to work as intended. Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- Reading git-diff-tree failed