diff options
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 237571af77fd..737d38865b69 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -614,7 +614,7 @@ static int __commit_transaction(struct dm_pool_metadata *pmd) | |||
614 | if (r < 0) | 614 | if (r < 0) |
615 | goto out; | 615 | goto out; |
616 | 616 | ||
617 | r = dm_sm_root_size(pmd->metadata_sm, &data_len); | 617 | r = dm_sm_root_size(pmd->data_sm, &data_len); |
618 | if (r < 0) | 618 | if (r < 0) |
619 | goto out; | 619 | goto out; |
620 | 620 | ||
@@ -713,6 +713,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
713 | if (r) | 713 | if (r) |
714 | goto bad; | 714 | goto bad; |
715 | 715 | ||
716 | if (bdev_size > THIN_METADATA_MAX_SECTORS) | ||
717 | bdev_size = THIN_METADATA_MAX_SECTORS; | ||
718 | |||
716 | disk_super = dm_block_data(sblock); | 719 | disk_super = dm_block_data(sblock); |
717 | disk_super->magic = cpu_to_le64(THIN_SUPERBLOCK_MAGIC); | 720 | disk_super->magic = cpu_to_le64(THIN_SUPERBLOCK_MAGIC); |
718 | disk_super->version = cpu_to_le32(THIN_VERSION); | 721 | disk_super->version = cpu_to_le32(THIN_VERSION); |