linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: cifs: transport: Use time_after for time comparison
@ 2017-05-11 23:53 Karim Eshapa
  2017-05-13  1:11 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Karim Eshapa @ 2017-05-11 23:53 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, samba-technical, linux-kernel, Karim Eshapa

Use time_after kernel macro for time comparison
that has safety check.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 fs/cifs/transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 4d64b5b..a7f5168 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: cifs: transport: Use time_after for time comparison
  2017-05-11 23:53 [PATCH] fs: cifs: transport: Use time_after for time comparison Karim Eshapa
@ 2017-05-13  1:11 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2017-05-13  1:11 UTC (permalink / raw)
  To: Karim Eshapa; +Cc: Steve French, linux-cifs, samba-technical, LKML

merged into cifs-2.6.git for-next

On Thu, May 11, 2017 at 6:53 PM, Karim Eshapa <karim.eshapa@gmail.com> wrote:
> Use time_after kernel macro for time comparison
> that has safety check.
>
> Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
> ---
>  fs/cifs/transport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 4d64b5b..a7f5168 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -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);
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-13  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 23:53 [PATCH] fs: cifs: transport: Use time_after for time comparison Karim Eshapa
2017-05-13  1:11 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).