From patchwork Thu Feb 14 11:15:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Aur=C3=A9lien_Aptel?= X-Patchwork-Id: 1042012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 440YjM0ddWz9sDL for ; Thu, 14 Feb 2019 22:15:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405053AbfBNLPs (ORCPT ); Thu, 14 Feb 2019 06:15:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:45880 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731242AbfBNLPs (ORCPT ); Thu, 14 Feb 2019 06:15:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E91EAAAA9; Thu, 14 Feb 2019 11:15:46 +0000 (UTC) From: Aurelien Aptel To: linux-cifs@vger.kernel.org Cc: piastryyy@gmail.com, Aurelien Aptel Subject: [cifs-utils PATCH v1] mount.cifs: be more verbose and helpful regarding mount errors Date: Thu, 14 Feb 2019 12:15:44 +0100 Message-Id: <20190214111544.24253-1-aaptel@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Aurelien Aptel --- mount.cifs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; }