Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: Bharath SM <bharathsm.hsk@gmail.com>
To: Steve French <smfrench@gmail.com>
Cc: Pierguido Lambri <plambri@redhat.com>,
	 Linux CIFS Mailing list <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] cifs.upcall: add option to enable debug logs
Date: Thu, 16 Apr 2026 12:31:21 +0000	[thread overview]
Message-ID: <CAGypqWx=051_KjZrfhXJfKVKjRDszkAXNz4fRfvv3S74g+BF=w@mail.gmail.com> (raw)
In-Reply-To: <CAH2r5mvgd9W4QJ603uv9UAQ6R=ASnORea532o8Ok7kjhJvEh4A@mail.gmail.com>

On Mon, Apr 13, 2026 at 7:23 AM Steve French <smfrench@gmail.com> wrote:
>
> merged the three patches into cifs-utils for-next
>
> On Thu, Jan 29, 2026 at 8:09 AM Pierguido Lambri <plambri@redhat.com> wrote:
> >
> > cifs.upcall uses two levels of logs, DEBUG and ERR.
> > However, when using systemd, these logs will always be recorded.
> > When the system does a lot of upcalls, the journal could be filled
> > with debug logs, which may not be useful at that time.
> > Added then a new option '-d' to enable debug logs only when needed.
> > This will set a logmask up to LOG_DEBUG instead of the default
> > of LOG_ERR, thus reducing the amount of logs when no debug is needed.
> >
> > Signed-off-by: Pierguido Lambri <plambri@redhat.com>
> > Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
> > ---
> >  cifs.upcall.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/cifs.upcall.c b/cifs.upcall.c
> > index 69e27a3..9c2843d 100644
> > --- a/cifs.upcall.c
> > +++ b/cifs.upcall.c
> > @@ -1356,7 +1356,7 @@ lowercase_string(char *c)
> >
> >  static void usage(void)
> >  {
> > -       fprintf(stderr, "Usage: %s [ -K /path/to/keytab] [-k /path/to/krb5.conf] [-E] [-t] [-v] [-l] [-e nsecs] key_serial\n", prog);
> > +       fprintf(stderr, "Usage: %s [ -K /path/to/keytab] [-k /path/to/krb5.conf] [-d] [-E] [-t] [-v] [-l] [-e nsecs] key_serial\n", prog);
> >  }
> >
> >  static const struct option long_options[] = {
> > @@ -1379,6 +1379,7 @@ int main(const int argc, char *const argv[])
> >         size_t datalen;
> >         long rc = 1;
> >         int c;
> > +       int mask;
> >         bool try_dns = false, legacy_uid = false , env_probe = true;
> >         char *buf;
> >         char hostbuf[NI_MAXHOST], *host;
> > @@ -1395,12 +1396,19 @@ int main(const int argc, char *const argv[])
> >         hostbuf[0] = '\0';
> >
> >         openlog(prog, 0, LOG_DAEMON);
> > +       mask = LOG_UPTO(LOG_ERR);
> > +       setlogmask(mask);
> >
> > -       while ((c = getopt_long(argc, argv, "cEk:K:ltve:", long_options, NULL)) != -1) {
> > +       while ((c = getopt_long(argc, argv, "cdEk:K:ltve:", long_options, NULL)) != -1) {
> >                 switch (c) {
> >                 case 'c':
> >                         /* legacy option -- skip it */
> >                         break;
> > +               case 'd':
> > +                       /* enable debug logs */
> > +                       mask = LOG_UPTO(LOG_DEBUG);
> > +                       setlogmask(mask);
> > +                       break;

I agree that journal can get very verbose when cifs makes many upcalls.
Looks like logging behavior is similar across other cifs-utils
programs like cifs-idmap.

If we need debug logs from customer devices, asking them to manually modify
cifs.spnego.conf with -d could be error-prone.

Should we consider a standardized way to enable debug logging across all
cifs-utils components and also with per binary basis to ensure
consistent behavior
and reduce misconfig?
One idea could be something like having /etc/cifs-utils/debug file to configure
debug level for cifs-utils and also additionally for per binary level.
Thoughts.?

      reply	other threads:[~2026-04-16 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 14:08 [PATCH v2 1/3] cifs.upcall: add option to enable debug logs Pierguido Lambri
2026-01-29 14:08 ` [PATCH v2 2/3] docs: Enable " Pierguido Lambri
2026-01-29 14:08 ` [PATCH v2 3/3] cifs.upcall: Adjust log level Pierguido Lambri
2026-04-13 14:21 ` [PATCH v2 1/3] cifs.upcall: add option to enable debug logs Steve French
2026-04-16 12:31   ` Bharath SM [this message]

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='CAGypqWx=051_KjZrfhXJfKVKjRDszkAXNz4fRfvv3S74g+BF=w@mail.gmail.com' \
    --to=bharathsm.hsk@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=plambri@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).