Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1830791imm; Tue, 2 Oct 2018 14:56:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV62/Ur0PTtB675sFNgnXyIOCUnHvwFxSNDM/zlaSt0Qb2217IiHpXcEYm9+U/AFA7paTfBk4 X-Received: by 2002:a63:ed09:: with SMTP id d9-v6mr10969672pgi.305.1538517360500; Tue, 02 Oct 2018 14:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538517360; cv=none; d=google.com; s=arc-20160816; b=JJQ4LC7ZdJASV45LnBGUNGwhD8+A4HCWILjjUocUkZS8oWerGBznBCpKc9AlNSsVKY E3LDVeMIp4UBuVS5+eKzb9quuX7G/nnzDBOytPjtvdanCyL62G4m7lOCGYg/ivz8sPJM fzkaE+Da9n5CKAsrxOEG75va6CdJdeZCD7uPbvG5s2s5tmlqX49c32Wf2iNzjb1QD2wb J4IA4KLAU+27rk2w3xEXN34ANnXVrqSN6nYGK8jPWQq6YkCi8P3jsSsETNnUnRFO1IFO ccDj/JjZgt96koF6FemJQB7etHdDD6LgSsD3B4nlH3mWhlHAxN3qErR0Q4uMiraE/hdY Eijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=uKlYtyoSYESMnqNMD5sIfzQU4i8GWevohC84lvBh3cM=; b=JLX9sKsgEIbi59LSDww/BscB7025I1kUsGt0nm0b5TjKry/nHrTFkiRg/GU7TrlrQT FRd6HgM+fKfKWL1qpPSE+ia9a3k4IQka5WA5oUxlYUcZEx8cvLDRhYD3fO+e+NIhCJlA MlDBFiUrKK69dulx0YYL8o54DKa2fXZkTWKDJydSbDG0rz3ScEIJzxouvQNEAsYnLyXN ZpsYOttCsGkeOujGLu+AtsphFGvcL5JF+rCL1x/Zrq8m4YhEU1A0cIRj96o/HiBvbU6e uAY9FMStj0U70S2+ACbGLmuLE+jecjPhPccbVC8gPwd5OAqzEyIsxLD9jNWJf90Ewfma 767A== 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 bd1-v6si17170742plb.156.2018.10.02.14.55.44; Tue, 02 Oct 2018 14:56:00 -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 S1728685AbeJCEjP (ORCPT + 99 others); Wed, 3 Oct 2018 00:39:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbeJCEjO (ORCPT ); Wed, 3 Oct 2018 00:39:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEDB230001DA; Tue, 2 Oct 2018 21:53:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5F7865F4D; Tue, 2 Oct 2018 21:53:46 +0000 (UTC) Received: from zmail19.collab.prod.int.phx2.redhat.com (zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D06B1809546; Tue, 2 Oct 2018 21:53:46 +0000 (UTC) Date: Tue, 2 Oct 2018 17:53:46 -0400 (EDT) From: Rodrigo Freire To: Steve French Cc: LKML , Steve French , CIFS , Pavel Shilovsky Message-ID: <633521295.32428133.1538517226400.JavaMail.zimbra@redhat.com> In-Reply-To: References: <194690850.32402710.1538508513975.JavaMail.zimbra@redhat.com> <697659653.32427271.1538515234390.JavaMail.zimbra@redhat.com> Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.116.170, 10.4.195.30] Thread-Topic: CIFS: Print message when attempting a mount Thread-Index: fcCBG1URbz1ia1uBPAR96T8BQ6e0RQ== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 02 Oct 2018 21:53:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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