Commit 10553a9
iomap: fix iomap_dio_zero() for fs bs > system page size
iomap_dio_zero() will pad a fs block with zeroes if the direct IO size
< fs block size. iomap_dio_zero() has an implicit assumption that fs block
size < page_size. This is true for most filesystems at the moment.
If the block size > page size, this will send the contents of the page
next to zero page(as len > PAGE_SIZE) to the underlying block device,
causing FS corruption.
iomap is a generic infrastructure and it should not make any assumptions
about the fs block size and the page size of the system.
Signed-off-by: Pankaj Raghav <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Reviewed-by: Daniel Gomez <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>1 parent 743a275 commit 10553a9
2 files changed
+41
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2007 | 2007 | | |
2008 | 2008 | | |
2009 | 2009 | | |
2010 | | - | |
| 2010 | + | |
2011 | 2011 | | |
2012 | 2012 | | |
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
2016 | | - | |
| 2016 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
235 | | - | |
| 243 | + | |
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
239 | | - | |
240 | 247 | | |
241 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
242 | 257 | | |
243 | 258 | | |
244 | 259 | | |
245 | 260 | | |
246 | 261 | | |
247 | 262 | | |
248 | 263 | | |
249 | | - | |
| 264 | + | |
250 | 265 | | |
| 266 | + | |
251 | 267 | | |
252 | 268 | | |
253 | 269 | | |
| |||
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
359 | | - | |
360 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
361 | 379 | | |
362 | 380 | | |
363 | 381 | | |
| |||
431 | 449 | | |
432 | 450 | | |
433 | 451 | | |
434 | | - | |
| 452 | + | |
| 453 | + | |
435 | 454 | | |
436 | 455 | | |
437 | 456 | | |
| |||
753 | 772 | | |
754 | 773 | | |
755 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
0 commit comments