mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis@igalia.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: mszeredi@redhat.com, fuse-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Matt Harvey <mharvey@jumptrading.com>,
	kernel-dev@igalia.com, stable@vger.kernel.org
Subject: Re: [PATCH] fuse: fix 'inval_wq' parameter setting during module initialisation
Date: Fri, 6 Nov 2026 12:29:55 +0000	[thread overview]
Message-ID: <au3IQ_tZrpCZ__Pl@igalia.com> (raw)
In-Reply-To: <CAJfpegsXsZS7CaA-=kAB4_oiyPWeZ8ULpG+kxBNHczM-XHbqng@mail.gmail.com>

On Fri, Nov 06, 2026 at 12:33:50PM +0100, Miklos Szeredi wrote:
> On Mon, 19 Oct 2026 at 14:52, Luis Henriques <luis@igalia.com> wrote:
> 
> > @@ -62,11 +61,14 @@ static int inval_wq_set(const char *val, const struct kernel_param *kp)
> >
> >         *((unsigned int *)kp->arg) = num;
> >
> > -       if (num && !old)
> > -               schedule_delayed_work(&dentry_tree_work,
> > -                                     secs_to_jiffies(num));
> > -       else if (!num && old)
> > -               cancel_delayed_work_sync(&dentry_tree_work);
> > +       /* Only start/stop workqueue if we're past module initialisation */
> > +       if (!module_is_coming(kp->mod)) {
> 
> See sashiko review:

*sigh*
I keep forgetting to check sashiko website.  Sorry about that :-/

> - kp->mod might be NULL which will Oops module_is_coming()

Hmm... I guess this should be fixable by adding a '!kp->mod' to the
condition:

	if (!kp->mod || !module_is_coming(kp->mod)) ...

> - it's still racy against fuse_dentry_tree_init

This one is a bit trickier indeed.  I could try to play a bit with the
modules notifiers (register_module_notifier).  But I haven't used that
before, so not sure it can be used, for example, kicking off the worker
later when the module has been initialised.

> 
> My question is: does the inval_wq_set() even need to work before the
> module is initialized?  Can't it just return an error and it wouldn't
> need to deal with the race.

That's probably the simplest option, but that would prevent us from, for
example, setting inval_wq as a kernel parameter, right?  Or doing:

  # modprobe fuse inval_wq=10

Do you think that's acceptable?

Cheers,
--
Luis

      reply	other threads:[~2026-11-06 12:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 12:53 Luis Henriques
2026-11-06 10:18 ` Luis Henriques
2026-11-06 11:33 ` Miklos Szeredi
2026-11-06 12:29   ` Luis Henriques [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=au3IQ_tZrpCZ__Pl@igalia.com \
    --to=luis@igalia.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mharvey@jumptrading.com \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@redhat.com \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®