Re: [PATCH v2] CIFS: Print message when attempting a mount

From: Steve French
Date: Sat Oct 06 2018 - 19:28:06 EST


Maybe simplest approach to address your request is to add a less noisy
(pr_notice, or pr_info if you prefer) as xfs does in the example you
mentioned:

> xfs_log.c: xfs_notice(mp, "Mounting V%d Filesystem",

Would be small addition to the following in cifs_debug.h

/* information message: e.g., configuration, major event */
#define cifs_dbg_func(ratefunc, type, fmt, ...) \
do { \
if ((type) & FYI && cifsFYI & CIFS_INFO) { \
pr_debug_ ## ratefunc("%s: " \
fmt, __FILE__, ##__VA_ARGS__); \
} else if ((type) & VFS) { \
pr_err_ ## ratefunc("CIFS VFS: " \
fmt, ##__VA_ARGS__); \



On Sat, Oct 6, 2018 at 2:32 PM Rodrigo Freire <rfreire@xxxxxxxxxx> wrote:
>
> Hi Steve! o/
>
> Appreciate your time and review.
>
> For a v3, what would you like more: a pr_info() straight away in the code
> for the message, or, writing a new cifs_info() function wrapping
> over pr_info, like we have in cifs_dbg (which translates to pr_debug or pr_err)?
>
> Waiting for your comments. Thanks!
>
> ---
> Rodrigo Freire - Principal Technical Account Manager
> GLOBAL CUSTOMER SUCCESS - Partnering with you to help achieve your business goals
> redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted
>
> ----- Original Message -----
>
> > From: "Steve French" <smfrench@xxxxxxxxx>
> > To: rfreire@xxxxxxxxxx
> > Cc: "LKML" <linux-kernel@xxxxxxxxxxxxxxx>, "Steve French"
> > <sfrench@xxxxxxxxx>, "CIFS" <linux-cifs@xxxxxxxxxxxxxxx>, "Pavel Shilovsky"
> > <piastryyy@xxxxxxxxx>
> > Sent: Saturday, October 6, 2018 4:09:30 PM
> > Subject: Re: [PATCH v2] CIFS: Print message when attempting a mount
>
> > On Tue, Oct 2, 2018 at 4:53 PM Rodrigo Freire <rfreire@xxxxxxxxxx> wrote:
> > >
> > > Hi hi again Steve \o
> > >
> > > I do see potential for a ftrace rewrite for the cifs_dbg messages.
>
> > Was looking at this on current kernels and debugging mount is probably
> > fine for developers (or users) - plenty of debug messages get printed
> > via the dynamic ftrace points. In practice some would prefer less
> > noisy trace logs so the minimum set for some would be something like
> > this (which already works with current cifs). If we want to add some
> > default log messages on mount to dmesg instead of the trace-cmd log,
> > maybe we should log them at a slightly less noisy level (as we see
> > with xfs and btrfs) so they will be more log friendly




--
Thanks,

Steve