Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mike Snitzer:
"Fix the dm-thinp and dm-cache targets to disallow changing the data
device's block size"

* tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm cache metadata: do not allow the data block size to change
dm thin metadata: do not allow the data block size to change

+18
+9
drivers/md/dm-cache-metadata.c
··· 425 425 426 426 disk_super = dm_block_data(sblock); 427 427 428 + /* Verify the data block size hasn't changed */ 429 + if (le32_to_cpu(disk_super->data_block_size) != cmd->data_block_size) { 430 + DMERR("changing the data block size (from %u to %llu) is not supported", 431 + le32_to_cpu(disk_super->data_block_size), 432 + (unsigned long long)cmd->data_block_size); 433 + r = -EINVAL; 434 + goto bad; 435 + } 436 + 428 437 r = __check_incompat_features(disk_super, cmd); 429 438 if (r < 0) 430 439 goto bad;
+9
drivers/md/dm-thin-metadata.c
··· 613 613 614 614 disk_super = dm_block_data(sblock); 615 615 616 + /* Verify the data block size hasn't changed */ 617 + if (le32_to_cpu(disk_super->data_block_size) != pmd->data_block_size) { 618 + DMERR("changing the data block size (from %u to %llu) is not supported", 619 + le32_to_cpu(disk_super->data_block_size), 620 + (unsigned long long)pmd->data_block_size); 621 + r = -EINVAL; 622 + goto bad_unlock_sblock; 623 + } 624 + 616 625 r = __check_incompat_features(disk_super, pmd); 617 626 if (r < 0) 618 627 goto bad_unlock_sblock;