From patchwork Mon Nov 16 16:38:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Hannemann X-Patchwork-Id: 7629071 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82D92BF90C for ; Mon, 16 Nov 2015 16:46:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76C1A205B5 for ; Mon, 16 Nov 2015 16:46:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 363D320465 for ; Mon, 16 Nov 2015 16:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbbKPQqN (ORCPT ); Mon, 16 Nov 2015 11:46:13 -0500 Received: from mail2.unitix.de ([176.9.125.4]:44065 "EHLO mail2.unitix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbbKPQqM (ORCPT ); Mon, 16 Nov 2015 11:46:12 -0500 X-Greylist: delayed 450 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Nov 2015 11:46:12 EST Received: from kallisto.credativ.lan (unknown [88.128.80.111]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail2.unitix.de (Postfix) with ESMTPSA id 427B940DF; Mon, 16 Nov 2015 17:38:37 +0100 (CET) From: Arnd Hannemann To: sfrench@samba.org, linux-cifs@vger.kernel.org Cc: Arnd Hannemann Subject: [PATCH] [CIFS] Print IP address of unresponsive server Date: Mon, 16 Nov 2015 17:38:28 +0100 Message-Id: <1447691908-4740-1-git-send-email-arnd@arndnet.de> X-Mailer: git-send-email 2.5.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before this patch, only the hostname of the server is printed when it becomes unresponsive. This might not be helpful, if the IP-Address has changed since initial mount when the name was resolved (e.g. because the IPv6-Prefix changed). This patch adds the cached IP address of the unresponsive server, to the log message. Signed-off-by: Arnd Hannemann --- fs/cifs/connect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 3f22285..8993309 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -482,8 +482,11 @@ server_unresponsive(struct TCP_Server_Info *server) */ if (server->tcpStatus == CifsGood && time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) { - cifs_dbg(VFS, "Server %s has not responded in %d seconds. Reconnecting...\n", - server->hostname, (2 * SMB_ECHO_INTERVAL) / HZ); + cifs_dbg(VFS, "Server %s (addr=%pISc) has not responded in " + "%d seconds. Reconnecting...\n", + server->hostname, + (struct sockaddr *)&server->dstaddr, + (2 * SMB_ECHO_INTERVAL) / HZ); cifs_reconnect(server); wake_up(&server->response_q); return true;