public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Freire <rfreire@redhat.com>
To: Steve French <smfrench@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Steve French <sfrench@samba.org>,
	CIFS <linux-cifs@vger.kernel.org>,
	Pavel Shilovsky <piastryyy@gmail.com>
Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount
Date: Tue, 2 Oct 2018 17:20:34 -0400 (EDT)	[thread overview]
Message-ID: <697659653.32427271.1538515234390.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAH2r5ms814MUNWVZNfCTuSO2LQZsmCs5N1nwgdVuhxtMctRE3Q@mail.gmail.com>

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" <smfrench@gmail.com>
> To: rfreire@redhat.com
> Cc: "LKML" <linux-kernel@vger.kernel.org>, "Steve French"
> <sfrench@samba.org>, "CIFS" <linux-cifs@vger.kernel.org>, "Pavel Shilovsky"
> <piastryyy@gmail.com>
> 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 <rfreire@redhat.com> wrote:
> >
> > Hi Steve,
> >
> > ----- Original Message -----
> > > From: "Steve French" <smfrench@gmail.com>
> > > To: rfreire@redhat.com
> > > Cc: "LKML" <linux-kernel@vger.kernel.org>, "Steve French"
> > > <sfrench@samba.org>, "CIFS" <linux-cifs@vger.kernel.org>, "Pavel
> > > Shilovsky"
> > > <piastryyy@gmail.com>
> > > 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 <rfreire@redhat.com> 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

  reply	other threads:[~2018-10-02 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 11:57 [PATCH v2] CIFS: Print message when attempting a mount Rodrigo Freire
2018-10-02 19:17 ` Steve French
2018-10-02 19:28   ` Rodrigo Freire
2018-10-02 20:35     ` Steve French
2018-10-02 21:20       ` Rodrigo Freire [this message]
2018-10-02 21:25         ` Steve French
2018-10-02 21:53           ` Rodrigo Freire
2018-10-06 17:13             ` Steve French
2018-10-06 19:09             ` Steve French
2018-10-06 19:32               ` Rodrigo Freire
2018-10-06 23:27                 ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=697659653.32427271.1538515234390.JavaMail.zimbra@redhat.com \
    --to=rfreire@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=piastryyy@gmail.com \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox