From: Tycho Andersen <tycho@tycho.pizza>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: "Jürg Billeter" <j@bitron.ch>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
regressions@lists.linux.dev
Subject: Re: [REGRESSION] fuse: execve() fails with ETXTBSY due to async fuse_flush
Date: Mon, 14 Aug 2023 16:36:40 -0600 [thread overview]
Message-ID: <ZNqseD4hqHWmeF2w@tycho.pizza> (raw)
In-Reply-To: <CAJfpegt6x_=F=mD8LEL4AZPbfCLGQrpurhtbDN4Ew50fd2ngqQ@mail.gmail.com>
On Mon, Aug 14, 2023 at 04:35:56PM +0200, Miklos Szeredi wrote:
> On Mon, 14 Aug 2023 at 16:00, Tycho Andersen <tycho@tycho.pizza> wrote:
>
> > It seems like we really do need to wait here. I guess that means we
> > need some kind of exit-proof wait?
>
> Could you please recap the original problem?
Sure, the symptom is a deadlock, something like:
# cat /proc/1528591/stack
[<0>] do_wait+0x156/0x2f0
[<0>] kernel_wait4+0x8d/0x140
[<0>] zap_pid_ns_processes+0x104/0x180
[<0>] do_exit+0xa41/0xb80
[<0>] do_group_exit+0x3a/0xa0
[<0>] __x64_sys_exit_group+0x14/0x20
[<0>] do_syscall_64+0x37/0xb0
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xae
which is stuck waiting for:
# cat /proc/1544574/stack
[<0>] request_wait_answer+0x12f/0x210
[<0>] fuse_simple_request+0x109/0x2c0
[<0>] fuse_flush+0x16f/0x1b0
[<0>] filp_close+0x27/0x70
[<0>] put_files_struct+0x6b/0xc0
[<0>] do_exit+0x360/0xb80
[<0>] do_group_exit+0x3a/0xa0
[<0>] get_signal+0x140/0x870
[<0>] arch_do_signal_or_restart+0xae/0x7c0
[<0>] exit_to_user_mode_prepare+0x10f/0x1c0
[<0>] syscall_exit_to_user_mode+0x26/0x40
[<0>] do_syscall_64+0x46/0xb0
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xae
I have a reproducer here:
https://github.com/tych0/kernel-utils/blob/master/fuse2/Makefile#L7
The problem is that the second thread has called do_exit() ->
exit_signals(), but then tries to request_wait_answer() which uses the
core wait primitives that no longer get woken up from signals due to
the code in exit_signals(). So when we try to exit the pid ns, the
whole cleanup hangs.
It seems we really do need to wait in do_exit(), otherwise we get
the behavior described in this regression...
Tycho
next prev parent reply other threads:[~2023-08-14 22:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 6:03 [REGRESSION] fuse: execve() fails with ETXTBSY due to async fuse_flush Jürg Billeter
2023-08-14 11:02 ` Miklos Szeredi
2023-08-14 12:07 ` Bernd Schubert
2023-08-14 12:28 ` Miklos Szeredi
2023-08-14 12:38 ` Jürg Billeter
2023-08-14 13:44 ` Bernd Schubert
2023-08-14 14:00 ` Tycho Andersen
2023-08-14 14:35 ` Miklos Szeredi
2023-08-14 22:36 ` Tycho Andersen [this message]
2023-08-21 14:24 ` Miklos Szeredi
2023-08-21 15:02 ` Tycho Andersen
2023-08-21 15:31 ` Miklos Szeredi
2023-08-29 17:42 ` Tycho Andersen
2023-08-14 21:34 ` Bernd Schubert
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=ZNqseD4hqHWmeF2w@tycho.pizza \
--to=tycho@tycho.pizza \
--cc=ebiederm@xmission.com \
--cc=j@bitron.ch \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=regressions@lists.linux.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;
as well as URLs for NNTP newsgroup(s).