]> git.baikalelectronics.ru Git - kernel.git/commit
dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 23 Feb 2021 20:21:20 +0000 (21:21 +0100)
committerMike Snitzer <snitzer@redhat.com>
Thu, 4 Mar 2021 19:53:54 +0000 (14:53 -0500)
commitbf977172bbaae51e48a5a0149ccfb97a68c4c059
tree32846198fd86f5d019701b0d1a0a0e69ebcf7788
parent47e4b9c1ff63df78203ad32499c59f3e7a26d65d
dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size

dm_bufio_get_device_size returns the device size in blocks. Before
returning the value, we must subtract the nubmer of starting
sectors. The number of starting sectors may not be divisible by block
size.

Note that currently, no target is using dm_bufio_set_sector_offset and
dm_bufio_get_device_size simultaneously, so this change has no effect.
However, an upcoming dm-verity-fec fix needs this change.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Milan Broz <gmazyland@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-bufio.c