Merge tag ‘gfs2-5.1.fixes2’ of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 [Linux 5.2]

Merge tag ‘gfs2-5.1.fixes2’ of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 [Linux 5.2]

This Linux kernel change "Merge tag ‘gfs2-5.1.fixes2’ of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2" is included in the Linux 5.2 release. This change is authored by Linus Torvalds <torvalds [at] linux-foundation.org> on Wed May 22 08:31:09 2019 -0700. The commit for this change in Linux stable tree is 651bae9 (patch). Other info about this change: Merge: f75b6f3 5a5ec83

Merge tag 'gfs2-5.1.fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2

Pull gfs2 fix from Andreas Gruenbacher:
 "Fix a gfs2 sign extension bug introduced in v4.3"

* tag 'gfs2-5.1.fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Fix sign extension bug in gfs2_update_stats

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/gfs2/lock_dlm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 31df26e..69bd159 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -31,9 +31,10 @@
  * @delta is the difference between the current rtt sample and the
  * running average srtt. We add 1/8 of that to the srtt in order to
  * update the current srtt estimate. The variance estimate is a bit
- * more complicated. We subtract the abs value of the @delta from
- * the current variance estimate and add 1/4 of that to the running
- * total.
+ * more complicated. We subtract the current variance estimate from
+ * the abs value of the @delta and add 1/4 of that to the running
+ * total.  That's equivalent to 3/4 of the current variance
+ * estimate plus 1/4 of the abs of @delta.
  *
  * Note that the index points at the array entry containing the smoothed
  * mean value, and the variance is always in the following entry
@@ -49,7 +50,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
    s64 delta = sample - s->stats[index];
    s->stats[index] += (delta >> 3);
    index++;
-   s->stats[index] += ((abs(delta) - s->stats[index]) >> 2);
+   s->stats[index] += (s64)(abs(delta) - s->stats[index]) >> 2;
 }

 /**

Leave a Reply

Your email address will not be published. Required fields are marked *