Commit d58ffe7
Desnes Nunes
debugfs: don't mess with bits in ->d_fsdata
JIRA: https://issues.redhat.com/browse/RHEL-78931
commit 9568880
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 12 Jan 2025 08:06:48 +0000
The reason we need that crap is the dual use ->d_fsdata has there -
it's both holding a debugfs_fsdata reference after the first
debugfs_file_get() (actually, after the call of proxy ->open())
*and* it serves as a place to stash a reference to real file_operations
from object creation to the first open. Oh, and it's triple use,
actually - that stashed reference might be to debugfs_short_fops.
Bugger that for a game of solidiers - just put the operations
reference into debugfs-private augmentation of inode. And split
debugfs_full_file_operations into full and short cases, so that
debugfs_get_file() could tell one from another.
Voila - ->d_fsdata holds NULL until the first (successful) debugfs_get_file()
and a reference to struct debugfs_fsdata afterwards.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/20250112080705.141166-4-viro@zeniv.linux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Desnes Nunes <desnesn@redhat.com>1 parent 2d8644d commit d58ffe7
3 files changed
+38
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 110 | + | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
| 127 | + | |
| 128 | + | |
130 | 129 | | |
131 | 130 | | |
132 | | - | |
| 131 | + | |
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | | - | |
| 228 | + | |
231 | 229 | | |
232 | 230 | | |
233 | 231 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | | - | |
| 259 | + | |
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
| |||
427 | 424 | | |
428 | 425 | | |
429 | 426 | | |
430 | | - | |
| 427 | + | |
431 | 428 | | |
432 | 429 | | |
433 | 430 | | |
434 | 431 | | |
435 | 432 | | |
436 | 433 | | |
437 | | - | |
438 | | - | |
| 434 | + | |
439 | 435 | | |
440 | 436 | | |
441 | 437 | | |
442 | 438 | | |
443 | 439 | | |
444 | 440 | | |
445 | | - | |
| 441 | + | |
446 | 442 | | |
447 | 443 | | |
448 | 444 | | |
| |||
452 | 448 | | |
453 | 449 | | |
454 | 450 | | |
455 | | - | |
| 451 | + | |
456 | 452 | | |
457 | 453 | | |
458 | 454 | | |
| |||
468 | 464 | | |
469 | 465 | | |
470 | 466 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 467 | + | |
| 468 | + | |
476 | 469 | | |
477 | 470 | | |
478 | 471 | | |
| |||
487 | 480 | | |
488 | 481 | | |
489 | 482 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | 483 | | |
496 | 484 | | |
497 | 485 | | |
| |||
504 | 492 | | |
505 | 493 | | |
506 | 494 | | |
507 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
508 | 506 | | |
509 | 507 | | |
510 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
253 | 249 | | |
254 | | - | |
255 | 250 | | |
256 | 251 | | |
257 | 252 | | |
| |||
459 | 454 | | |
460 | 455 | | |
461 | 456 | | |
| 457 | + | |
| 458 | + | |
462 | 459 | | |
463 | | - | |
464 | | - | |
| 460 | + | |
465 | 461 | | |
466 | 462 | | |
467 | 463 | | |
| |||
472 | 468 | | |
473 | 469 | | |
474 | 470 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | 471 | | |
480 | | - | |
481 | | - | |
| 472 | + | |
482 | 473 | | |
483 | 474 | | |
484 | 475 | | |
| |||
487 | 478 | | |
488 | 479 | | |
489 | 480 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | 481 | | |
495 | | - | |
496 | | - | |
| 482 | + | |
497 | 483 | | |
498 | 484 | | |
499 | 485 | | |
| |||
531 | 517 | | |
532 | 518 | | |
533 | 519 | | |
534 | | - | |
535 | | - | |
| 520 | + | |
536 | 521 | | |
537 | 522 | | |
538 | 523 | | |
| |||
737 | 722 | | |
738 | 723 | | |
739 | 724 | | |
740 | | - | |
| 725 | + | |
741 | 726 | | |
742 | 727 | | |
743 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 57 | | |
64 | 58 | | |
65 | 59 | | |
| |||
0 commit comments