Commit 4d4ed3f
fuse: fix inode initialization race
Fix a race between fuse_iget() and fuse_reverse_inval_inode() where
invalidation can arrive while an inode is being initialized, causing
the invalidation to be lost.
Add a waitqueue to make fuse_reverse_inval_inode() wait when it
encounters an inode with attr_version == 0 (still initializing).
When fuse_change_attributes_common() completes initialization, it
wakes waiting threads.
This ensures invalidations are properly serialized with inode
initialization, maintaining cache coherency.
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
(cherry picked from commit 03eacfd)1 parent ccaf499 commit 4d4ed3f
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
898 | 901 | | |
899 | 902 | | |
900 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
604 | 605 | | |
605 | 606 | | |
606 | 607 | | |
| 608 | + | |
607 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
608 | 616 | | |
609 | 617 | | |
610 | | - | |
| 618 | + | |
611 | 619 | | |
612 | 620 | | |
613 | 621 | | |
| |||
1024 | 1032 | | |
1025 | 1033 | | |
1026 | 1034 | | |
| 1035 | + | |
1027 | 1036 | | |
1028 | 1037 | | |
1029 | 1038 | | |
| |||
0 commit comments