aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2009-10-12 13:07:49 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2009-11-04 09:21:00 -0500
commit1352994b363195ce932749d3518d4dc9a5479fea (patch)
tree244a0a02f549a94d0e65f1934ea8f947ccd57547 /drivers/block
parentad19bf6e544f4d1abc22d2be130c7d5e4163146f (diff)
drbd: fix check for too large lower level device
To check wether we are truncating a very large device due to limited meta data space, we need to check the ll_dev size. Also improve the printk to suggest "flexible" or "internal". Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_nl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 22538d9628f1..e2a5875a07b1 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -894,11 +894,6 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
894 min_md_device_sectors = MD_RESERVED_SECT * (nbc->dc.meta_dev_idx + 1); 894 min_md_device_sectors = MD_RESERVED_SECT * (nbc->dc.meta_dev_idx + 1);
895 } 895 }
896 896
897 if (drbd_get_capacity(nbc->md_bdev) > max_possible_sectors)
898 dev_warn(DEV, "truncating very big lower level device "
899 "to currently maximum possible %llu sectors\n",
900 (unsigned long long) max_possible_sectors);
901
902 if (drbd_get_capacity(nbc->md_bdev) < min_md_device_sectors) { 897 if (drbd_get_capacity(nbc->md_bdev) < min_md_device_sectors) {
903 retcode = ERR_MD_DISK_TO_SMALL; 898 retcode = ERR_MD_DISK_TO_SMALL;
904 dev_warn(DEV, "refusing attach: md-device too small, " 899 dev_warn(DEV, "refusing attach: md-device too small, "
@@ -917,6 +912,15 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
917 912
918 nbc->known_size = drbd_get_capacity(nbc->backing_bdev); 913 nbc->known_size = drbd_get_capacity(nbc->backing_bdev);
919 914
915 if (nbc->known_size > max_possible_sectors) {
916 dev_warn(DEV, "==> truncating very big lower level device "
917 "to currently maximum possible %llu sectors <==\n",
918 (unsigned long long) max_possible_sectors);
919 if (nbc->dc.meta_dev_idx >= 0)
920 dev_warn(DEV, "==>> using internal or flexible "
921 "meta data may help <<==\n");
922 }
923
920 drbd_suspend_io(mdev); 924 drbd_suspend_io(mdev);
921 /* also wait for the last barrier ack. */ 925 /* also wait for the last barrier ack. */
922 wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt)); 926 wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt));