aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-03-24 11:07:04 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 19:17:47 -0400
commit6495d2c6d04f4c45411fdb1b40527c24015f39d6 (patch)
treecb7262a4b4750bb0fba045f492ffedbf8eef6701 /drivers/block/drbd
parentb4ee79dac3bddc468e21cae0deb00b80ec4ac051 (diff)
drbd: Implemented the --assume-clean option for drbdsetup resize
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_nl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 6f7933376a11..19b9a2851e7b 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1479,6 +1479,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1479 int retcode = NO_ERROR; 1479 int retcode = NO_ERROR;
1480 int ldsc = 0; /* local disk size changed */ 1480 int ldsc = 0; /* local disk size changed */
1481 enum determine_dev_size dd; 1481 enum determine_dev_size dd;
1482 enum dds_flags ddsf;
1482 1483
1483 memset(&rs, 0, sizeof(struct resize)); 1484 memset(&rs, 0, sizeof(struct resize));
1484 if (!resize_from_tags(mdev, nlp->tag_list, &rs)) { 1485 if (!resize_from_tags(mdev, nlp->tag_list, &rs)) {
@@ -1502,13 +1503,19 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1502 goto fail; 1503 goto fail;
1503 } 1504 }
1504 1505
1506 if (rs.no_resync && mdev->agreed_pro_version < 93) {
1507 retcode = ERR_NEED_APV_93;
1508 goto fail;
1509 }
1510
1505 if (mdev->ldev->known_size != drbd_get_capacity(mdev->ldev->backing_bdev)) { 1511 if (mdev->ldev->known_size != drbd_get_capacity(mdev->ldev->backing_bdev)) {
1506 mdev->ldev->known_size = drbd_get_capacity(mdev->ldev->backing_bdev); 1512 mdev->ldev->known_size = drbd_get_capacity(mdev->ldev->backing_bdev);
1507 ldsc = 1; 1513 ldsc = 1;
1508 } 1514 }
1509 1515
1510 mdev->ldev->dc.disk_size = (sector_t)rs.resize_size; 1516 mdev->ldev->dc.disk_size = (sector_t)rs.resize_size;
1511 dd = drbd_determin_dev_size(mdev, rs.resize_force ? DDSF_FORCED : 0); 1517 ddsf = (rs.resize_force ? DDSF_FORCED : 0) | (rs.no_resync ? DDSF_NO_RESYNC : 0);
1518 dd = drbd_determin_dev_size(mdev, ddsf);
1512 drbd_md_sync(mdev); 1519 drbd_md_sync(mdev);
1513 put_ldev(mdev); 1520 put_ldev(mdev);
1514 if (dd == dev_size_error) { 1521 if (dd == dev_size_error) {
@@ -1521,7 +1528,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1521 set_bit(RESIZE_PENDING, &mdev->flags); 1528 set_bit(RESIZE_PENDING, &mdev->flags);
1522 1529
1523 drbd_send_uuids(mdev); 1530 drbd_send_uuids(mdev);
1524 drbd_send_sizes(mdev, 1, 0); 1531 drbd_send_sizes(mdev, 1, ddsf);
1525 } 1532 }
1526 1533
1527 fail: 1534 fail: