Bug 13795 - Race condition in fs/cifs/connect.c causing "has not responded in 120 seconds. Reconnecting..."
Summary: Race condition in fs/cifs/connect.c causing "has not responded in 120 seconds...
Status: CLOSED FIXED
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 3.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Steve French
QA Contact: cifs QA contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-19 12:16 UTC by Lutz Donnerhacke
Modified: 2020-08-06 21:47 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lutz Donnerhacke 2019-02-19 12:16:49 UTC
Detailed description of the bug:
 https://lutz.donnerhacke.de/eng/Blog/Groundhog-Day-with-SMB-remount

Summary of the race condition:
 1) Daisy chaining scheduling creates a gap.
 2) If traffic comes unfortunate shortly after
    the last echo, the planned echo is suppressed.
 3) Due to the gap, the next echo transmission is delayed
    until after the timeout, which is set hard to twice
    the echo interval.

Possible solutions:
 a) Eliminate the gap by scheduling at fixed times.
 b) Send the echo requests in any case regardless of other traffic.
 c) Avoiding the entire problem by waiting at least three times
    the interval length.

For a quick fix change the 2 to a 3 in the code:
https://github.com/torvalds/linux/blob/master/fs/cifs/connect.c#L712

I was advised to open this ticket here, despite there is the same one in https://bugzilla.kernel.org/show_bug.cgi?id=202611
Comment 1 Lutz Donnerhacke 2019-05-27 10:24:43 UTC
Is there anything unclear in this ticket?

What are the reasons to deny the recommended quick fix?
Do you need a patch file?
Comment 2 Björn Jacke 2019-06-03 22:19:04 UTC
Hi Lutz, as you worked out the issee quite well I think sending a git format patch to https://lists.samba.org/mailman/listinfo/linux-cifs-client makes upstream inclusion most likely. Thanks for your efforts!
Comment 3 Pavel Shilovsky 2020-08-04 23:00:58 UTC
The fix went into 5.3-rc1 (mainline) and 5.2.7, 4.19.65,  4.14.137, 4.9.224, 4.4.224 (stable) kernel versions.