Blame SOURCES/0011-mount.cifs-be-more-verbose-and-helpful-regarding-mou.patch

5eee7b
From 368b0d656eaa0c529743d582a36a46d994b260dd Mon Sep 17 00:00:00 2001
5eee7b
From: Aurelien Aptel <aaptel@suse.com>
5eee7b
Date: Thu, 14 Feb 2019 12:15:44 +0100
5eee7b
Subject: [PATCH 11/36] mount.cifs: be more verbose and helpful regarding mount
5eee7b
 errors
5eee7b
5eee7b
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
5eee7b
(cherry picked from commit 3a00449ea2560c1f160ca5e69a48a5078bfa1194)
5eee7b
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
5eee7b
---
5eee7b
 mount.cifs.c | 12 +++++++++++-
5eee7b
 1 file changed, 11 insertions(+), 1 deletion(-)
5eee7b
5eee7b
diff --git a/mount.cifs.c b/mount.cifs.c
5eee7b
index ae7a899..9370f2e 100644
5eee7b
--- a/mount.cifs.c
5eee7b
+++ b/mount.cifs.c
5eee7b
@@ -2099,6 +2099,10 @@ mount_retry:
5eee7b
 		switch (errno) {
5eee7b
 		case ECONNREFUSED:
5eee7b
 		case EHOSTUNREACH:
5eee7b
+			if (currentaddress) {
5eee7b
+				fprintf(stderr, "mount error(%d): could not connect to %s",
5eee7b
+					errno, currentaddress);
5eee7b
+			}
5eee7b
 			currentaddress = nextaddress;
5eee7b
 			if (currentaddress) {
5eee7b
 				nextaddress = strchr(currentaddress, ',');
5eee7b
@@ -2110,6 +2114,12 @@ mount_retry:
5eee7b
 			fprintf(stderr,
5eee7b
 				"mount error: %s filesystem not supported by the system\n", cifs_fstype);
5eee7b
 			break;
5eee7b
+		case EHOSTDOWN:
5eee7b
+			fprintf(stderr,
5eee7b
+				"mount error: Server abruptly closed the connection.\n"
5eee7b
+				"This can happen if the server does not support the SMB version you are trying to use.\n"
5eee7b
+				"The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.\n");
5eee7b
+			break;
5eee7b
 		case ENXIO:
5eee7b
 			if (!already_uppercased &&
5eee7b
 			    uppercase_string(parsed_info->host) &&
5eee7b
@@ -2126,7 +2136,7 @@ mount_retry:
5eee7b
 			strerror(errno));
5eee7b
 		fprintf(stderr,
5eee7b
 			"Refer to the %s(8) manual page (e.g. man "
5eee7b
-			"%s)\n", thisprogram, thisprogram);
5eee7b
+			"%s) and kernel log messages (dmesg)\n", thisprogram, thisprogram);
5eee7b
 		rc = EX_FAIL;
5eee7b
 		goto mount_exit;
5eee7b
 	}
5eee7b
-- 
5eee7b
1.8.3.1
5eee7b