All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: rafael.tinoco@linaro.org, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] tst_mkfs: print short hint when mkfs fails in device busy
Date: Fri, 15 Aug 2025 07:22:31 +0200	[thread overview]
Message-ID: <20250815052231.GA32490@pevik> (raw)
In-Reply-To: <CAEemH2fgnJH201_fvDvPRbAFrfdEz4v_cEg-LXudWje-+w68VA@mail.gmail.com>

> Petr Vorel <pvorel@suse.cz> wrote:

> > > diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
> > > index 736324f04..dfec06a21 100644
> > > --- a/lib/tst_mkfs.c
> > > +++ b/lib/tst_mkfs.c
> > > @@ -107,6 +107,10 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
> > >                       "%s not found in $PATH", mkfs);
> > >       break;
> > >       default:
> > > +             tst_resm_(file, lineno, TWARN,
> > > +                     "Check if mkfs failed with the (loop) device busy. "
> > > +                     "Background probing (e.g., udisks2) can cause this. \n"
> > When 2 lines are needed, could it be without trailing space?
> >                         "Background probing (e.g., udisks2) can cause this.\n"

> > nit: I don't like LTP messages are split on more lines, but this is indeed too
> > long.

> +1

> > > +                     "Consider temporarily stopping udisks2 during the test.");

> > We already have suggestion about some process running in tst_umount()
> > in lib/tst_device.c:

> >                         tst_resm(TINFO, "Likely gvfsd-trash is probing newly "
> >                                  "mounted fs, kill it to speed up tests.");

> This is a good example, thanks!!

> (The debugging work exhausted my energy this week, and I felt like my
> brain was stuck there, unable to write a simple printed message.)

Understand :).

> So what about:

>  tst_resm_(file, lineno, TWARN,
>     "mkfs may have failed because the device is busy (e.g., udisks2 probing). "
>     "Consider disabling background probing services.");

+1

> > Would you agree to have a library function which would parse
> > /proc/*/comm to check if particular process is running?
> > (I would do it as a separate effort).

> Yes, that would be helpful to confirm some special damon is running,
> if something you were mean:

> if (tst_proc_comm_running("udisksd", NULL) ||
>     tst_proc_comm_running("gvfsd-trash", NULL)) {
>     tst_resm_(file, lineno, TINFO,
>               "Likely udisksd/gvfsd-trash is probing newly mounted fs
> in backgroud... ");
> }

Yes, something like this. It can be done as a separate effort to not block this
simple patch.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-08-15  5:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 14:17 [LTP] [PATCH v2] tst_mkfs: print short hint when mkfs fails in device busy Li Wang via ltp
2025-08-14 13:06 ` Petr Vorel
2025-08-15  0:44   ` Li Wang via ltp
2025-08-15  5:22     ` Petr Vorel [this message]
2025-08-16  1:38       ` Li Wang via ltp

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=20250815052231.GA32490@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=rafael.tinoco@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.