Whamcloud - gitweb
LU-12931 gnilnd: use time_after() to compare jiffies 02/36702/5
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 7 Nov 2019 06:33:55 +0000 (23:33 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:34:35 +0000 (05:34 +0000)
Fix a potential bug in gnilnd it is directly comparing a timeout
against jiffies instead of using time_after() to handle jiffies wrap.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie4d190e9c04e807f2152b71dc28ef0b0463ebbe5
Reviewed-on: https://review.whamcloud.com/36702
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index 411dbff..bab50cb 100644 (file)
@@ -135,7 +135,7 @@ kgnilnd_quiesce_wait(char *reason)
-                       LASSERTF(quiesce_deadline > jiffies,
+                       LASSERTF(time_after(quiesce_deadline, jiffies),
                                 "couldn't quiesce threads in %lu seconds, falling over now\n",