dm log writes: fix >512b sectorsize support
authorJosef Bacik <jbacik@fb.com>
Fri, 28 Jul 2017 14:42:25 +0000 (10:42 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 11 Sep 2017 14:03:12 +0000 (10:03 -0400)
commit228bb5b26038a7d58b7c11af1297f34b534b59cd
treee088b35b4159c6155ba26f5f37b688777300245c
parent0c79c62021d23f0b5c942cf59d43a7ce6c24cd1b
dm log writes: fix >512b sectorsize support

512b sectors vs device's physical sectorsize was not maintained
consistently and as such the support for >512b sector devices has bugs.
The log metadata expects native sectorsize but 512b sectors were being
stored.  Also, device's sectorsize was assumed when assigning the
bi_sector for blocks that were being logged.

Fix this up by adding two helpers to convert between bio and dev
sectors, and use these in the appropriate places to fix the problem and
make it clear which units go where.  Doing so allows dm-log-writes use
with 4k devices.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-log-writes.c