Bug 6728 - fuse: in fuse_flush only wait if someone wants the return code
Summary: fuse: in fuse_flush only wait if someone wants the return code
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: fs (show other bugs) fs
Version: unspecified
Hardware: All Linux
: P3-Medium S5-enhancement
Target Milestone: ---
Assignee: Jingbo Xu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-08 10:20 UTC by ningmingxiao
Modified: 2024-01-22 14:56 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ningmingxiao 2023-10-08 10:20:27 UTC
Description of problem:
If a fuse filesystem is mounted inside a container, there is a problem
during pid namespace destruction. The scenario is:

1. task (a thread in the fuse server, with a fuse file open) starts
   exiting, does exit_signals(), goes into fuse_flush() -> wait
2. fuse daemon gets killed, tries to wake everyone up
3. task from 1 is stuck because complete_signal() doesn't wake it up, since
   it has PF_EXITING.

The result is that the thread will never be woken up, and pid namespace
destruction will block indefinitely.

To add insult to injury, nobody is waiting for these return codes, since
the pid namespace is being destroyed.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 ningmingxiao 2023-10-08 10:21:11 UTC
If a fuse filesystem is mounted inside a container, there is a problem
during pid namespace destruction. The scenario is:

1. task (a thread in the fuse server, with a fuse file open) starts
   exiting, does exit_signals(), goes into fuse_flush() -> wait
2. fuse daemon gets killed, tries to wake everyone up
3. task from 1 is stuck because complete_signal() doesn't wake it up, since
   it has PF_EXITING.

The result is that the thread will never be woken up, and pid namespace
destruction will block indefinitely.

To add insult to injury, nobody is waiting for these return codes, since
the pid namespace is being destroyed.
Comment 2 ningmingxiao 2023-10-08 10:23:38 UTC
fuse: in fuse_flush only wait if someone wants the return code
ref:https://github.com/torvalds/linux/commit/5a8bee63b10f6f2f52f6d22e109a4a147409842a
Comment 3 小龙 admin 2023-10-08 11:03:20 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2259
Comment 4 Jingbo Xu alibaba_cloud_group 2023-10-10 09:55:23 UTC
merged