diff options
author | Paulo Alcantara (SUSE) <pc@cjr.nz> | 2019-10-10 11:31:58 -0400 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-10-20 20:19:49 -0400 |
commit | d532cc7efdfd7bf4b9e1c287d823e584843f1de1 (patch) | |
tree | 599d16d32e3d5de86353b42ebf18c08c8bf81a3a | |
parent | 7d194c2100ad2a6dded545887d02754948ca5241 (diff) |
cifs: Handle -EINPROGRESS only when noblockcnt is set
We only want to avoid blocking in connect when mounting SMB root
filesystems, otherwise bail out from generic_ip_connect() so cifs.ko
can perform any reconnect failover appropriately.
This fixes DFS failover/reconnection tests in upstream buildbot.
Fixes: 8eecd1c2e5bc ("cifs: Add support for root file systems")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r-- | fs/cifs/connect.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index a64dfa95a925..bdea4b3e8005 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -3882,8 +3882,12 @@ generic_ip_connect(struct TCP_Server_Info *server) | |||
3882 | 3882 | ||
3883 | rc = socket->ops->connect(socket, saddr, slen, | 3883 | rc = socket->ops->connect(socket, saddr, slen, |
3884 | server->noblockcnt ? O_NONBLOCK : 0); | 3884 | server->noblockcnt ? O_NONBLOCK : 0); |
3885 | 3885 | /* | |
3886 | if (rc == -EINPROGRESS) | 3886 | * When mounting SMB root file systems, we do not want to block in |
3887 | * connect. Otherwise bail out and then let cifs_reconnect() perform | ||
3888 | * reconnect failover - if possible. | ||
3889 | */ | ||
3890 | if (server->noblockcnt && rc == -EINPROGRESS) | ||
3887 | rc = 0; | 3891 | rc = 0; |
3888 | if (rc < 0) { | 3892 | if (rc < 0) { |
3889 | cifs_dbg(FYI, "Error %d connecting to server\n", rc); | 3893 | cifs_dbg(FYI, "Error %d connecting to server\n", rc); |