Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp720846imm; Mon, 1 Oct 2018 17:59:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV6373WcnERzUNRHWRqxTuvLsnHgqF+xvpACCeBHIYE1CFXLjMZMp9GNFPh1eDSADc7W0xuF6 X-Received: by 2002:a62:571b:: with SMTP id l27-v6mr8747920pfb.209.1538441961655; Mon, 01 Oct 2018 17:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538441961; cv=none; d=google.com; s=arc-20160816; b=oHqFWQ8dMrmVF+ML5iBz40PV1DFJSvdZ067O1K+XCOZh57ZnqzQ8V/LHPf9YBPrXUA SrKbgJwDhElqCW8FopB1lmHdd2VKz4bd1gfHW3OHTOGhyPR55JRVFdl2nlAxKV99OeHB G0TP6ZFwjX5JN+Cto8iZKoDh69moKVy/dU/trXoALHnxtiE4UxzazZkukxXu3g8TMwLp ReUWmmJvtibipnmNT61Oxbn06voqyfissWQp54GlypIzQWNWdqw8e3mESeb3Ty/Vxxja kUd3gMuaindfJwxYUQsEGTurEUQC8ThYu1VqPK8ePnfxADJ2y3P0vemlbQGO3BY7kQYg z8PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=D1i53dN3KTVnOYlxmJV+/0jIalCfEkFqKXlrqtha7W4=; b=T49E0AHiTsWLKeeieKLCCDTphs+R2c+JF2pboHrSccTYobMdzjtmT+iAqZ+cPlGmdW CthQIkgAL51vO2jxJMOpH1wWlSMKg035on1G9ENrVG28QYoRzEcSJGNl0Dd5M1W/UiA0 bDVnvfzIKZFNKjbzU+WolabIYUjql4b3ogVrzjuqGsadQ9LtkBjs48h65l099X5C5ZMY kIwjOcnwgeIMgYcMm/yXX6V0uRX1BICt0HjcjX0QRgM4Ga/tp6t2Mxe04PCFIgWbCn+j UjBXGN4JA7LHnKyLrKedpkzt/J9bVa4hnrQ3+m3gnwKMwH1IzXw0bJ2EymVSzdwMsV/3 zauA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si5866587pgh.35.2018.10.01.17.59.07; Mon, 01 Oct 2018 17:59:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbeJBHjc (ORCPT + 99 others); Tue, 2 Oct 2018 03:39:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbeJBHjc (ORCPT ); Tue, 2 Oct 2018 03:39:32 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30913307D844; Tue, 2 Oct 2018 00:59:03 +0000 (UTC) Received: from rf.usersys.redhat.com (ovpn-116-170.phx2.redhat.com [10.3.116.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47CDD10016DC; Tue, 2 Oct 2018 00:59:02 +0000 (UTC) From: Rodrigo Freire To: linux-kernel@vger.kernel.org Cc: sfrench@samba.org, linux-cifs@vger.kernel.org Subject: [PATCH] CIFS: Print message when attempting mount Date: Mon, 1 Oct 2018 21:58:46 -0300 Message-Id: <463f424e3d4724a4ab7b84c395e7b0cf3068e31f.1538441538.git.rfreire@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 02 Oct 2018 00:59:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By default, no messages are printed when mounting a CIFS filesystem. This information is valuable when troubleshooting and/or forensic analyzing a system and finding out if was a CIFS endpoint mount attempted. Other filesystems such as XFS, EXT* does issue a printk() when mounting their filesystems. Sample output: [root@ll-rhel7 ~]# mount -o user=administrator //172.25.250.18/c$ /mnt (non-existent system) [root@ll-rhel7 ~]# mount -o user=administrator //172.25.250.19/c$ /mnt (Valid system) Kernel message log: [ 450.464543] CIFS VFS: Attempting to mount //172.25.250.18/c$ [ 456.478186] CIFS VFS: Error connecting to socket. Aborting operation. [ 456.478381] CIFS VFS: cifs_mount failed w/return code = -113 [ 467.688866] CIFS VFS: Attempting to mount //172.25.250.19/c$ Signed-off-by: Rodrigo Freire --- fs/cifs/cifsfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 7065426..3f5a31e 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -707,6 +707,7 @@ static int cifs_set_super(struct super_block *sb, void *data) struct cifs_mnt_data mnt_data; struct dentry *root; + cifs_dbg(VFS, "Attempting to mount %s\n", dev_name); cifs_dbg(FYI, "Devname: %s flags: %d\n", dev_name, flags); volume_info = cifs_get_volume_info((char *)data, dev_name, is_smb3); -- 1.8.3.1