Commit 6564862
block: Ensure start sector is aligned for stacking atomic writes
For stacking atomic writes, ensure that the start sector is aligned with
the device atomic write unit min and any boundary. Otherwise, we may
permit misaligned atomic writes.
Rework bdev_can_atomic_write() into a common helper to resuse the
alignment check. There also use atomic_write_hw_unit_min, which is more
proper (than atomic_write_unit_min).
Fixes: d7f36dc ("block: Support atomic writes limits for stacked devices")
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: John Garry <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent 6593815 commit 6564862
2 files changed
+17
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
| 612 | + | |
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
620 | 623 | | |
621 | 624 | | |
622 | 625 | | |
| |||
799 | 802 | | |
800 | 803 | | |
801 | 804 | | |
802 | | - | |
| 805 | + | |
803 | 806 | | |
804 | 807 | | |
805 | 808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
1709 | 1718 | | |
1710 | 1719 | | |
1711 | 1720 | | |
| |||
1714 | 1723 | | |
1715 | 1724 | | |
1716 | 1725 | | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
1726 | 1729 | | |
1727 | 1730 | | |
1728 | 1731 | | |
| |||
0 commit comments