Commit 5de5ed8
committed
fix(vfs): skip CAS round-trip for reads on reused-staging opens
The prior commit installed sparse_write on the can_reuse_staging path
to enable range_upload at flush time. That regressed reads: a writable
handle that hadn't written anything yet would still call
fill_sparse_holes, which downloaded CAS bytes for the whole read region
even though the staging file already held the full original content.
Add a `staging_holds_full_original` flag to SparseWriteState, set via
`new_with_full_staging` on the reused-staging path only. When true,
fill_sparse_holes short-circuits — staging is the source of truth for
non-dirty bytes, and track_write keeps that invariant on subsequent
writes. Fresh sparse opens (where staging is an actual hole) leave the
flag false and continue to fill from CAS.1 parent 9a3099e commit 5de5ed8
2 files changed
Lines changed: 69 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
| |||
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
185 | 204 | | |
186 | 205 | | |
187 | 206 | | |
| |||
2697 | 2716 | | |
2698 | 2717 | | |
2699 | 2718 | | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2700 | 2745 | | |
2701 | 2746 | | |
2702 | 2747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
1795 | 1799 | | |
1796 | 1800 | | |
1797 | | - | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
1798 | 1807 | | |
1799 | 1808 | | |
1800 | 1809 | | |
| |||
2132 | 2141 | | |
2133 | 2142 | | |
2134 | 2143 | | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
2135 | 2153 | | |
2136 | 2154 | | |
2137 | 2155 | | |
| |||
0 commit comments