cfq: explicitly use 64bit divide operation for 64bit arguments
authorAnatol Pomozov <anatol.pomozov@gmail.com>
Sun, 22 Sep 2013 18:43:47 +0000 (12:43 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2013 16:41:02 +0000 (09:41 -0700)
commit02911e1cf4c15e4046480ae33ff44d91cd6c0b36
tree875c57d4559aec74b4558d720e47d62c4b985942
parent9d51f688c6b430d76683a964adc947c00e23f78a
cfq: explicitly use 64bit divide operation for 64bit arguments

commit f3cff25f05f2ac29b2ee355e611b0657482f6f1d upstream.

'samples' is 64bit operant, but do_div() second parameter is 32.
do_div silently truncates high 32 bits and calculated result
is invalid.

In case if low 32bit of 'samples' are zeros then do_div() produces
kernel crash.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Jonghwan Choi <jhbird.choi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/cfq-iosched.c