summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2019-02-14 12:15:44 +0100
committerPavel Shilovsky <pshilov@microsoft.com>2019-02-14 16:40:58 -0800
commit3a00449ea2560c1f160ca5e69a48a5078bfa1194 (patch)
tree483d971502ed657c9a23c8604fe7b33e0022a666
parentb101af793c8415f298072d06841a278df0368bc3 (diff)
downloadcifs-utils-3a00449ea2560c1f160ca5e69a48a5078bfa1194.tar.gz
cifs-utils-3a00449ea2560c1f160ca5e69a48a5078bfa1194.tar.bz2
cifs-utils-3a00449ea2560c1f160ca5e69a48a5078bfa1194.zip
mount.cifs: be more verbose and helpful regarding mount errors
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
-rw-r--r--mount.cifs.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index ae7a899..9370f2e 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -2099,6 +2099,10 @@ mount_retry:
switch (errno) {
case ECONNREFUSED:
case EHOSTUNREACH:
+ if (currentaddress) {
+ fprintf(stderr, "mount error(%d): could not connect to %s",
+ errno, currentaddress);
+ }
currentaddress = nextaddress;
if (currentaddress) {
nextaddress = strchr(currentaddress, ',');
@@ -2110,6 +2114,12 @@ mount_retry:
fprintf(stderr,
"mount error: %s filesystem not supported by the system\n", cifs_fstype);
break;
+ case EHOSTDOWN:
+ fprintf(stderr,
+ "mount error: Server abruptly closed the connection.\n"
+ "This can happen if the server does not support the SMB version you are trying to use.\n"
+ "The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.\n");
+ break;
case ENXIO:
if (!already_uppercased &&
uppercase_string(parsed_info->host) &&
@@ -2126,7 +2136,7 @@ mount_retry:
strerror(errno));
fprintf(stderr,
"Refer to the %s(8) manual page (e.g. man "
- "%s)\n", thisprogram, thisprogram);
+ "%s) and kernel log messages (dmesg)\n", thisprogram, thisprogram);
rc = EX_FAIL;
goto mount_exit;
}