Skip to content

Commit d532cc7

Browse files
Paulo Alcantara (SUSE)smfrench
authored andcommitted
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: 8eecd1c ("cifs: Add support for root file systems") Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7d194c2 commit d532cc7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/cifs/connect.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,8 +3882,12 @@ generic_ip_connect(struct TCP_Server_Info *server)
38823882

38833883
rc = socket->ops->connect(socket, saddr, slen,
38843884
server->noblockcnt ? O_NONBLOCK : 0);
3885-
3886-
if (rc == -EINPROGRESS)
3885+
/*
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)
38873891
rc = 0;
38883892
if (rc < 0) {
38893893
cifs_dbg(FYI, "Error %d connecting to server\n", rc);

0 commit comments

Comments
 (0)