]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fs: cifs: transport: Use time_after for time comparison
authorKarim Eshapa <karim.eshapa@gmail.com>
Thu, 11 May 2017 23:53:38 +0000 (01:53 +0200)
committerSteve French <smfrench@gmail.com>
Sat, 13 May 2017 00:56:44 +0000 (19:56 -0500)
Use time_after kernel macro for time comparison
that has safety check.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/transport.c

index de589d0d3739275c5aeac9b4a489055a4695203a..47a125ece11ea0d3e2daa0814c8cab28b4643bb1 100644 (file)
@@ -94,7 +94,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
        now = jiffies;
        /* commands taking longer than one second are indications that
           something is wrong, unless it is quite a slow link or server */
-       if ((now - midEntry->when_alloc) > HZ) {
+       if (time_after(now, midEntry->when_alloc + HZ)) {
                if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {
                        pr_debug(" CIFS slow rsp: cmd %d mid %llu",
                               midEntry->command, midEntry->mid);