Skip to content

Commit 4328fea

Browse files
karimeshapaLinuxsmfrench
authored andcommitted
fs: cifs: transport: Use time_after for time comparison
Use time_after kernel macro for time comparison that has safety check. Signed-off-by: Karim Eshapa <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent cd12300 commit 4328fea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
9494
now = jiffies;
9595
/* commands taking longer than one second are indications that
9696
something is wrong, unless it is quite a slow link or server */
97-
if ((now - midEntry->when_alloc) > HZ) {
97+
if (time_after(now, midEntry->when_alloc + HZ)) {
9898
if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {
9999
pr_debug(" CIFS slow rsp: cmd %d mid %llu",
100100
midEntry->command, midEntry->mid);

0 commit comments

Comments
 (0)