Commit 4ce6e06
authored
fix(fs): stabilize epoll and namespace lifecycles (#2165)
* fix(fs): stabilize epoll and namespace lifecycles
Eliminate the epoll wait lock inversion by removing the unreachable shutdown state and keeping waiter registration entirely within the ready-state synchronization domain.
Refresh proc task entries by PID object identity and thread-group ownership so recycled TIDs cannot resolve stale cached directories. Resolve proc namespace magic links to namespace-backed files and preserve their mount projection through anonymous, non-cached dentries, allowing bind mounts to outlive the source task without leaking wrapper-cache entries.
Add concurrent epoll ctl/wait coverage and namespace bind-lifetime regression coverage, including checks that ordinary proc fd magic-link projection remains unchanged.
Validation:
- make fmt
- make kernel
- DragonOS proc PID/TID reuse, UTS namespace, epoll, and mount suites
- CubeSandbox container create/exec/destroy, 5/5 on the final kernel
Signed-off-by: longjin <longjin@dragonos.org>
* fix(procfs): preserve namespace fd identities
Carry a stable namespace dentry name with mount-projected magic-link targets so open namespace descriptors render type:[inode] instead of falling back to anon_inode.
Keep bind-mounted namespace descriptors on the ordinary mount path and expose anonymous namespace roots in mountinfo without a leading slash, matching Linux d_path and nsfs semantics.
Extend the namespace bind regression test to cover the original fd identity, the bind-mounted fd path, and the mountinfo root.
Signed-off-by: longjin <longjin@dragonos.org>
---------
Signed-off-by: longjin <longjin@dragonos.org>1 parent 4a99bd4 commit 4ce6e06
10 files changed
Lines changed: 613 additions & 81 deletions
File tree
- kernel/src/filesystem
- epoll
- procfs
- pid
- template
- vfs
- mount
- user/apps/tests/dunitest
- suites/normal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
80 | | - | |
81 | | - | |
82 | 77 | | |
83 | 78 | | |
84 | 79 | | |
| |||
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
99 | | - | |
100 | 94 | | |
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
104 | 98 | | |
105 | 99 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 100 | | |
114 | 101 | | |
115 | 102 | | |
| |||
455 | 442 | | |
456 | 443 | | |
457 | 444 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | 445 | | |
464 | 446 | | |
465 | 447 | | |
| |||
524 | 506 | | |
525 | 507 | | |
526 | 508 | | |
527 | | - | |
528 | | - | |
529 | | - | |
| 509 | + | |
530 | 510 | | |
531 | 511 | | |
532 | 512 | | |
| |||
555 | 535 | | |
556 | 536 | | |
557 | 537 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | 538 | | |
563 | 539 | | |
564 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
49 | 36 | | |
50 | 37 | | |
51 | | - | |
| 38 | + | |
52 | 39 | | |
53 | 40 | | |
54 | | - | |
| 41 | + | |
55 | 42 | | |
56 | 43 | | |
57 | 44 | | |
58 | | - | |
| 45 | + | |
59 | 46 | | |
60 | 47 | | |
61 | 48 | | |
62 | 49 | | |
63 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
64 | 53 | | |
65 | 54 | | |
66 | 55 | | |
| |||
71 | 60 | | |
72 | 61 | | |
73 | 62 | | |
74 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
129 | 140 | | |
130 | 141 | | |
131 | 142 | | |
| |||
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
| 151 | + | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| 158 | + | |
146 | 159 | | |
147 | 160 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
152 | 198 | | |
153 | 199 | | |
154 | 200 | | |
155 | 201 | | |
156 | 202 | | |
157 | | - | |
| 203 | + | |
158 | 204 | | |
159 | 205 | | |
160 | 206 | | |
161 | 207 | | |
162 | 208 | | |
163 | 209 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
167 | 225 | | |
168 | 226 | | |
169 | 227 | | |
170 | | - | |
| 228 | + | |
171 | 229 | | |
172 | | - | |
| 230 | + | |
173 | 231 | | |
174 | 232 | | |
175 | 233 | | |
176 | | - | |
| 234 | + | |
177 | 235 | | |
178 | 236 | | |
179 | 237 | | |
0 commit comments