Jaegeuk Kim 8ca7cab82b dm verity fec: fix misaligned RS roots IO
commit df7b59ba9245 ("dm verity: fix FEC for RS roots unaligned to
block size") introduced the possibility for misaligned roots IO
relative to the underlying device's logical block size. E.g. Android's
default RS roots=2 results in dm_bufio->block_size=1024, which causes
the following EIO if the logical block size of the device is 4096,
given v->data_dev_block_bits=12:

E sd 0    : 0:0:0: [sda] tag#30 request not aligned to the logical block size
E blk_update_request: I/O error, dev sda, sector 10368424 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
E device-mapper: verity-fec: 254:8: FEC 9244672: parity read failed (block 18056): -5

Fix this by onlu using f->roots for dm_bufio blocksize IFF it is
aligned to v->data_dev_block_bits.

Fixes: df7b59ba9245 ("dm verity: fix FEC for RS roots unaligned to block size")
Cc: stable@vger.kernel.org
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-04-14 14:28:29 -04:00
..
2021-02-26 15:49:51 -07:00
2021-02-26 15:49:51 -07:00
2020-07-08 17:20:46 -06:00
2021-02-03 10:13:00 -05:00
2020-12-16 13:09:32 -08:00
2021-02-01 09:35:20 -07:00
2021-01-27 09:51:48 -07:00
2020-12-16 12:57:51 -08:00
2021-01-27 09:51:48 -07:00
2019-03-12 10:15:18 -07:00
2021-02-21 11:06:54 -08:00