]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix sign extension bug in gfs2_update_stats
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 17 May 2019 18:18:43 +0000 (19:18 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 22 May 2019 12:09:44 +0000 (14:09 +0200)
commit381b299771e4cc6769cc6b9e46ea91fffff1508e
treeba7ac34e9dbe8e0795b3704e36d5bdb88dc01faa
parent49250288820449e26abffc1305ba221bd05ce90d
gfs2: Fix sign extension bug in gfs2_update_stats

Commit c8e3c21955b0 changed the types of the statistic values in struct
gfs2_lkstats from s64 to u64.  Because of that, what should be a signed
value in gfs2_update_stats turned into an unsigned value.  When shifted
right, we end up with a large positive value instead of a small negative
value, which results in an incorrect variance estimate.

Fixes: c8e3c21955b0 ("gfs2: Make statistics unsigned, suitable for use with do_div()")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: stable@vger.kernel.org # v4.4+
fs/gfs2/lock_dlm.c