]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: round down size diff when shrinking/growing device
authorNikolay Borisov <nborisov@suse.com>
Fri, 21 Jul 2017 08:28:24 +0000 (11:28 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Jul 2017 14:05:00 +0000 (16:05 +0200)
commitc43f28de0453bd4d808b9751f2837970b494a0c7
treeda38571564787f0e289ca307712f99fb7671c933
parentdb9a36a200f5cb3fcaff45472ea9f9ad9f1c54ad
btrfs: round down size diff when shrinking/growing device

Further testing showed that the fix introduced in 357a3fb0818b ("btrfs:
Round down values which are written for total_bytes_size") was
insufficient and it could still lead to discrepancies between the
total_bytes in the super block and the device total bytes. So this patch
also ensures that the difference between old/new sizes when
shrinking/growing is also rounded down. This ensure that we won't be
subtracting/adding a non-sectorsize multiples to the superblock/device
total sizees.

Fixes: 357a3fb0818b ("btrfs: Round down values which are written for total_bytes_size")
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c