diff options
author | Justin Maggard <jmaggard10@gmail.com> | 2014-01-21 11:18:29 -0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 13:20:43 -0800 |
commit | c41570c9d29764f797fa35490d72b7395a0105c3 (patch) | |
tree | 899a43d2fe64b55478215fbb061f963cd87cf549 /fs/bio.c | |
parent | c736c095de53c1a0a23909239d69bb56693df8ef (diff) |
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 <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/bio.c')
0 files changed, 0 insertions, 0 deletions