Repository navigation
Commit 2be4751
ext4: fix 2nd xfstests 127 punch hole failure
This patch fixes a second punch hole bug found by xfstests 127.
This bug happens because punch hole needs to flush the pages
of the hole to avoid race conditions. But if the end of the
hole is in the same page as i_size, the buffer heads beyond
i_size need to be unmapped and the page needs to be zeroed
after it is flushed.
To correct this, the new ext4_discard_partial_page_buffers
routine is used to zero and unmap the partial page
beyond i_size if the end of the hole appears in the same
page as i_size.
The code has also been optimized to set the end of the hole
to the page after i_size if the specified hole exceeds i_size,
and the code that flushes the pages has been simplified.
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>1 parent ba06208 commit 2be4751
1 file changed
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4166 | 4166 | | |
4167 | 4167 | | |
4168 | 4168 | | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
4169 | 4183 | | |
4170 | 4184 | | |
4171 | 4185 | | |
| |||
4182 | 4196 | | |
4183 | 4197 | | |
4184 | 4198 | | |
4185 | | - | |
4186 | | - | |
| 4199 | + | |
4187 | 4200 | | |
4188 | | - | |
4189 | | - | |
| 4201 | + | |
| 4202 | + | |
4190 | 4203 | | |
4191 | 4204 | | |
4192 | 4205 | | |
| |||
4249 | 4262 | | |
4250 | 4263 | | |
4251 | 4264 | | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
| 4272 | + | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
4252 | 4285 | | |
4253 | 4286 | | |
4254 | 4287 | | |
| |||
0 commit comments