aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-thin.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2013-05-19 13:57:50 -0400
committerAlasdair G Kergon <agk@redhat.com>2013-05-19 13:57:50 -0400
commit610bba8b9372597967aefdc8d90661d2ab248802 (patch)
tree85f53a32606d8082cc26f13cd681acdccf2cfa5b /drivers/md/dm-thin.c
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
dm thin: fix metadata dev resize detection
Fix detection of the need to resize the dm thin metadata device. The code incorrectly tried to extend the metadata device when it didn't need to due to a merging error with patch 24347e9 ("dm thin: detect metadata device resizing"). device-mapper: transaction manager: couldn't open metadata space map device-mapper: thin metadata: tm_open_with_sm failed device-mapper: thin: aborting transaction failed device-mapper: thin: switching pool to failure mode Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r--drivers/md/dm-thin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 759cffc45cab..88f2f802d528 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2188,7 +2188,7 @@ static int maybe_resize_metadata_dev(struct dm_target *ti, bool *need_commit)
2188 2188
2189 *need_commit = false; 2189 *need_commit = false;
2190 2190
2191 metadata_dev_size = get_metadata_dev_size(pool->md_dev); 2191 metadata_dev_size = get_metadata_dev_size_in_blocks(pool->md_dev);
2192 2192
2193 r = dm_pool_get_metadata_dev_size(pool->pmd, &sb_metadata_dev_size); 2193 r = dm_pool_get_metadata_dev_size(pool->pmd, &sb_metadata_dev_size);
2194 if (r) { 2194 if (r) {
@@ -2197,7 +2197,7 @@ static int maybe_resize_metadata_dev(struct dm_target *ti, bool *need_commit)
2197 } 2197 }
2198 2198
2199 if (metadata_dev_size < sb_metadata_dev_size) { 2199 if (metadata_dev_size < sb_metadata_dev_size) {
2200 DMERR("metadata device (%llu sectors) too small: expected %llu", 2200 DMERR("metadata device (%llu blocks) too small: expected %llu",
2201 metadata_dev_size, sb_metadata_dev_size); 2201 metadata_dev_size, sb_metadata_dev_size);
2202 return -EINVAL; 2202 return -EINVAL;
2203 2203