Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1781481imm; Sat, 6 Oct 2018 10:13:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV63umcVjdElrqex2Tb04z8tBglFxYLm7toyIVeimIOudCymNtR6XgQDRjfiK+f3Xwc8weIjB X-Received: by 2002:a63:5b63:: with SMTP id l35-v6mr14853678pgm.50.1538846033414; Sat, 06 Oct 2018 10:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538846033; cv=none; d=google.com; s=arc-20160816; b=S9yZpX7p3hE4zlQV62zGshWdkfTOhiredx684xxl/iLzPaYj6eLhdG1FadyR6AEYXD ETCnupKvA+09h/ObIJAFriaO9bmmj2MEuEaeDmVDyQ27h5FlpIYHH8yFKnIhrhrGdRI4 D/RcGmwzNpQb3IFzKwljNbpONbYCcRYZbfD4lHvWaNgpuCcZGTsHJ8kNFVNA6xtxsjsB O6wBVSKMFuCiA1Xs7eEEiI8n9PtsxUX7FPqC5nk6EcOo9uJgrk9fyVEUpez8jhinctqJ 8NdwQbl2maSjwFqHTa7TiNCG9o2AHaZX2efbOmUEVrxjbIp+i+q5ilP0vlW1Vn7UVQzR 2XTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=k2gQvgXrlUH8NfuGbEuSrp6F1PCTCKheb5SRVVbHzKQ=; b=ikDRVbXDm62Yb9jDX3ph5qs6hpPVIV5xheJLVAvUsp08t4OnAJuIQdC3a2OXWtwtez OrPUzIeqpUWNFUGOREChkRWa1+htwDj/IO62RkEazWEEHLcO6t+uU5ljTtRVJmDl3WO5 a7WvJUvKubjnka0XMxRdzeZbitLLCKDchQh9IxcFcgm/mx5z5ucp01UHynh/+MVM4YZU K0QT4ux8b4LpM43RW5cBFN3SS0YXJytNsJWyVEYQvQomjcw0XT+czpj6oAvx55HWT9ZD yLc5664I9oBdl+PIhwpuhRsWu9/o9farwosb2GDRqiQ6m8Dj7NlqQLxXhHXGZs+fCoih 1BDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samba.org header.s=42627210 header.b=Re6eOdq9; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si10376211pgp.42.2018.10.06.10.13.35; Sat, 06 Oct 2018 10:13:53 -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; dkim=pass header.i=@samba.org header.s=42627210 header.b=Re6eOdq9; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbeJGARh (ORCPT + 99 others); Sat, 6 Oct 2018 20:17:37 -0400 Received: from hr2.samba.org ([144.76.82.148]:44880 "EHLO hr2.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbeJGARh (ORCPT ); Sat, 6 Oct 2018 20:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42627210; h=Date:Message-ID:From:Cc:To; bh=k2gQvgXrlUH8NfuGbEuSrp6F1PCTCKheb5SRVVbHzKQ=; b=Re6eOdq9ifI+yGmxjAvIqj4Vsn R96xVCcuT7JLwJISR166Ar8b7bPch5cEK06Myj8V8t2zIfKpbNDEkqclqKJNU29tSJ5KrxKpv47pV iqDPE32f1XvjGMHKo+pzohWn6oQuehQ7yXE8MU8+/ZSMG+vONctnWE4F5aQz88aGXQpc=; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.2:ECDHE_ECDSA_CHACHA20_POLY1305:256) (Exim) id 1g8q8q-0007nM-S7; Sat, 06 Oct 2018 17:13:25 +0000 Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount To: Rodrigo Freire , Steve French Cc: LKML , CIFS , Pavel Shilovsky , linux-fsdevel@vger.kernel.org References: <194690850.32402710.1538508513975.JavaMail.zimbra@redhat.com> <697659653.32427271.1538515234390.JavaMail.zimbra@redhat.com> <633521295.32428133.1538517226400.JavaMail.zimbra@redhat.com> From: Steve French Message-ID: Date: Sat, 6 Oct 2018 12:13:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <633521295.32428133.1538517226400.JavaMail.zimbra@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Comparing what other file systems print to dmesg at mount time is interesting - just tried it forĀ  four file systems, two log nothing by default, two log something. See below. BTRFS: root@smf-Thinkpad-P51:~/# mount /btrfs root@smf-Thinkpad-P51:~/c# dmesg [96283.701117] BTRFS info (device mmcblk0p1): disk space caching is enabled [96283.701121] BTRFS info (device mmcblk0p1): has skinny extents [96283.708477] BTRFS info (device mmcblk0p1): enabling ssd optimizations EXT4: root@smf-Thinkpad-P51:~# mount /dev/nvme0n1p6 /ext4 root@smf-Thinkpad-P51:~# dmesg [96654.422038] EXT4-fs (nvme0n1p6): mounted filesystem with ordered data mode. Opts: (null) VFAT: root@smf-Thinkpad-P51:~# mount /dev/nvme0n1p1 /fat root@smf-Thinkpad-P51:~# dmesg root@smf-Thinkpad-P51:~# NFS (it logs messages first time the module is loaded, for the id_resolver, but not for the mount): root@smf-Thinkpad-P51:~# mount -t nfs localhost:/nfsexport /nfs root@smf-Thinkpad-P51:~# dmesg root@smf-Thinkpad-P51:~# On 10/02/2018 04:53 PM, Rodrigo Freire wrote: > Hi hi again Steve \o > > I do see potential for a ftrace rewrite for the cifs_dbg messages. > > But for the original post, I am aiming for a message to be printed > and found in dmesg, helping to correlate and troubleshoot events in > production systems. > > So given the debugging nature of ftrace, this is not of help for my > patch request. > > So, ACK for v2, using cifs_dbg(VFS) which actually translates to a > pr_warn(), or request a V3 using pr_info() (which I am absolutely fine > with) or...? > > Let me know. > > I appreciate your time and review! > > - RF. > > ----- Original Message ----- > >> From: "Steve French" >> To: rfreire@redhat.com >> Cc: "LKML" , "Steve French" >> , "CIFS" , "Pavel Shilovsky" >> >> Sent: Tuesday, October 2, 2018 6:25:46 PM >> Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount >> It is an interesting question - my gut reaction is that messages that >> need more immediate attention should be logged as KERN_ERR (similar to >> cifs_dbg(VFS ...) but given how easy it is now to use dynamic tracing >> and better to read, if a developer would need it ... probably best to >> use ftrace (trace-cmd). Note that xfs has more than 570 (!) dynamic >> trace point callouts now vs. fewer than 30 for xfs_notice >> On Tue, Oct 2, 2018 at 4:20 PM Rodrigo Freire wrote: >>> Hi Steve o/ >>> >>> I personally like more a pr_info() instead of a cifs_dbg (which wraps to a >>> pr_warn). But in order to keep in line with the general CIFS coding style >>> I stuck to cifs_dbg >>> >>> But I would happily rewrite the cifs_dbg to pr_info a v3: That would be >>> good enough too. >>> >>> Ah for what is worth my test/target systems are CentOS/Red Hat Enterprise >>> Linux. >>> >>> Thoughts? >>> >>> Thanks! >>> >>> - RF. >>> >>> ----- Original Message ----- >>>> From: "Steve French" >>>> To: rfreire@redhat.com >>>> Cc: "LKML" , "Steve French" >>>> , "CIFS" , "Pavel >>>> Shilovsky" >>>> >>>> Sent: Tuesday, October 2, 2018 5:35:49 PM >>>> Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount >>>> I noticed that on at least the first system I looked at (Ubuntu 18.04) >>>> it defaults to KERN_WARNING (ie 4) so wouldn't have shown a KERN_INFO >>>> which is level 6 (as the mount example from ext4) by default >>>> or the xfs_notice (which is level 5) >>>> https://elinux.org/Debugging_by_printing >>>> On Tue, Oct 2, 2018 at 2:28 PM Rodrigo Freire wrote: >>>>> Hi Steve, >>>>> >>>>> ----- Original Message ----- >>>>>> From: "Steve French" >>>>>> To: rfreire@redhat.com >>>>>> Cc: "LKML" , "Steve French" >>>>>> , "CIFS" , "Pavel >>>>>> Shilovsky" >>>>>> >>>>>> Sent: Tuesday, October 2, 2018 4:17:02 PM >>>>>> Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount >>>>>> >>>>>> Are you sure that these aren't logged by the automounter (for ext4, >>>>>> xfs etc.). When I looked in my dmesg logs I didn't find matching log >>>>>> entries in the file systems themselves. Do you have an example? >>>>> I'm positive about it. Check it out: >>>>> >>>>> [rfreire@rf ~]$ cd git/upstream/fs/ext4/ >>>>> [rfreire@rf ext4]$ >>>>> [rfreire@rf ext4]$ >>>>> [rfreire@rf ext4]$ grep -r "mounted filesystem with" >>>>> super.c: ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. " >>>>> >>>>> >>>>> [rfreire@rf ext4]$ dmesg | grep mount >>>>> [ 21.550897] EXT4-fs (dm-1): mounted filesystem with ordered data mode. >>>>> Opts: (null) >>>>> [ 22.216213] EXT4-fs (dm-1): re-mounted. Opts: discard >>>>> [ 22.598267] EXT4-fs (sda1): mounted filesystem with ordered data mode. >>>>> Opts: (null) >>>>> [ 22.605225] EXT4-fs (sdc): mounted filesystem without journal. Opts: >>>>> discard >>>>> [ 24.029161] EXT4-fs (dm-2): mounted filesystem with ordered data mode. >>>>> Opts: (null) >>>>> [ 24.047777] EXT4-fs (dm-4): mounted filesystem without journal. Opts: >>>>> (null) >>>>> >>>>> XFS sample dmesg (from >>>>> https://www.reddit.com/r/archlinux/comments/40b9r9/xfs_partition_is_mounted_during_boot_and_then/): >>>>> >>>>> [ 2.764491] XFS (sdb1): Mounting V5 Filesystem >>>>> [ 3.200886] XFS (sdb1): Ending clean mount >>>>> [ 5.384218] XFS (sdb1): Unmounting Filesystem >>>>> >>>>> Relevant code: >>>>> >>>>> [rfreire@rf ~]$ cd ../xfs >>>>> >>>>> [rfreire@rf xfs]$ grep "Mounting V" *.c >>>>> xfs_log.c: xfs_notice(mp, "Mounting V%d Filesystem", >>>>> >>>>> >>>>>> On the idea of adding cifsFYI logging here - I slightly prefer using >>>>>> ftrace (trace-cmd, ie dynamic tracing) so there is less overhead and >>>>>> easier to turn on/off following the example of xfs, f2fs, nfs, nfsd >>>>>> etc. >>>>> Remember that cifsFYI already exists; I just moved it inside a if >>>>> clause >>>>> to print it only when running under debug. (they way it is originally). >>>>> >>>>>> On Tue, Oct 2, 2018 at 6:57 AM Rodrigo Freire >>>>>> wrote: >>>>>>> Currently, no messages are printed when mounting a CIFS filesystem >>>>>>> and >>>>>>> no debug configuration is enabled. >>>>>>> >>>>>>> However, a CIFS mount 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. >>>>> >>>>>> -- >>>>>> Thanks, >>>>> Thank You! o/ >>>> -- >>>> Thanks, >>>> Steve >> -- >> Thanks, >> Steve