mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Christian Brauner" <brauner@kernel.org>,
	"Georgios Androutsopoulos" <georgeandrout13@gmail.com>,
	"Miguel Ojeda" <ojeda@kernel.org>, "Jan Kara" <jack@suse.cz>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	linux-fsdevel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rust: file: handle fd table teardown in file descriptor APIs
Date: Tue, 29 Sep 2026 15:53:58 +0100	[thread overview]
Message-ID: <20260929145358.GC989762@ZenIV> (raw)
In-Reply-To: <CAH5fLgis-9ibYAEK-shQtwg_08Le-JDYChS77LugEhgZ=T+z8Q@mail.gmail.com>

On Tue, Sep 29, 2026 at 03:35:13PM +0200, Alice Ryhl wrote:

> Sorry I mixed it up ... the code called file_close_fd() and then
> filp_close() with current->files. The important call here is the
> file_close_fd() one, not the filp_close() one.

Er...  But that would *not* see NULL ->files in case of workqueue -
you'd get init_files instead.  vhost_task_create() is the only
thing that creates threads with NULL ->files; it might or might
not make sense to have the same for workqueue worker threads,
but that wouldn't change anything in that bug anyway.

When you want to change the state of a thread component, be it
descriptor table, cwd, umask, etc., you'd better do that in
a thread that *does* share that component with the thread you
want to have affected.

It's not a matter of race with exiting thread - closing a descriptor
via schedule_work() is _always_ wrong.

I really don't get it...

  reply	other threads:[~2026-09-29 14:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  2:23 Georgios Androutsopoulos
2026-09-24  8:39 ` Alice Ryhl
2026-09-24 16:06   ` Georgios Androutsopoulos
2026-09-24 16:18     ` Pedro Falcato
2026-09-25 16:00   ` Christian Brauner
2026-09-29  4:48     ` Al Viro
2026-09-29  8:49       ` Alice Ryhl
2026-09-29 13:28         ` Al Viro
2026-09-29 13:35           ` Alice Ryhl
2026-09-29 14:53             ` Al Viro [this message]
2026-09-29 12:24       ` Gary Guo
2026-09-29 13:51         ` Al Viro
2026-09-29 16:07           ` Gary Guo
2026-09-29 17:02             ` Al Viro
2026-09-29 18:22               ` Gary Guo
2026-09-28 10:42 ` kernel test robot

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=20260929145358.GC989762@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=brauner@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=georgeandrout13@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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®