Commit b4d78cf
dm-integrity: align the outgoing bio in integrity_recheck
It is possible to set up dm-integrity with smaller sector size than
the logical sector size of the underlying device. In this situation,
dm-integrity guarantees that the outgoing bios have the same alignment as
incoming bios (so, if you create a filesystem with 4k block size,
dm-integrity would send 4k-aligned bios to the underlying device).
This guarantee was broken when integrity_recheck was implemented.
integrity_recheck sends bio that is aligned to ic->sectors_per_block. So
if we set up integrity with 512-byte sector size on a device with logical
block size 4k, we would be sending unaligned bio. This triggered a bug in
one of our internal tests.
This commit fixes it by determining the actual alignment of the
incoming bio and then makes sure that the outgoing bio in
integrity_recheck has the same alignment.
Fixes: c88f5e5 ("dm-integrity: recheck the integrity tag after a failure")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>1 parent 6e7132e commit b4d78cf
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1699 | 1699 | | |
1700 | 1700 | | |
1701 | 1701 | | |
1702 | | - | |
1703 | 1702 | | |
1704 | 1703 | | |
1705 | 1704 | | |
| |||
1708 | 1707 | | |
1709 | 1708 | | |
1710 | 1709 | | |
1711 | | - | |
1712 | 1710 | | |
1713 | 1711 | | |
1714 | 1712 | | |
1715 | 1713 | | |
1716 | 1714 | | |
| 1715 | + | |
1717 | 1716 | | |
| 1717 | + | |
1718 | 1718 | | |
1719 | 1719 | | |
1720 | 1720 | | |
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
1730 | 1738 | | |
1731 | 1739 | | |
1732 | 1740 | | |
| |||
0 commit comments