diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-03-24 11:07:04 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:17:47 -0400 |
commit | 6495d2c6d04f4c45411fdb1b40527c24015f39d6 (patch) | |
tree | cb7262a4b4750bb0fba045f492ffedbf8eef6701 | |
parent | b4ee79dac3bddc468e21cae0deb00b80ec4ac051 (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>
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 11 | ||||
-rw-r--r-- | include/linux/drbd.h | 3 | ||||
-rw-r--r-- | include/linux/drbd_nl.h | 1 |
3 files changed, 12 insertions, 3 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: |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 4341b1a97a34..7944dd36ee3e 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -56,7 +56,7 @@ extern const char *drbd_buildtag(void); | |||
56 | #define REL_VERSION "8.3.7" | 56 | #define REL_VERSION "8.3.7" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 92 | 59 | #define PRO_VERSION_MAX 93 |
60 | 60 | ||
61 | 61 | ||
62 | enum drbd_io_error_p { | 62 | enum drbd_io_error_p { |
@@ -139,6 +139,7 @@ enum drbd_ret_codes { | |||
139 | ERR_DATA_NOT_CURRENT = 150, | 139 | ERR_DATA_NOT_CURRENT = 150, |
140 | ERR_CONNECTED = 151, /* DRBD 8.3 only */ | 140 | ERR_CONNECTED = 151, /* DRBD 8.3 only */ |
141 | ERR_PERM = 152, | 141 | ERR_PERM = 152, |
142 | ERR_NEED_APV_93 = 153, | ||
142 | 143 | ||
143 | /* insert new ones above this line */ | 144 | /* insert new ones above this line */ |
144 | AFTER_LAST_ERR_CODE | 145 | AFTER_LAST_ERR_CODE |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index f7431a4ca608..de055c07c2ba 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
@@ -71,6 +71,7 @@ NL_PACKET(disconnect, 6, ) | |||
71 | NL_PACKET(resize, 7, | 71 | NL_PACKET(resize, 7, |
72 | NL_INT64( 29, T_MAY_IGNORE, resize_size) | 72 | NL_INT64( 29, T_MAY_IGNORE, resize_size) |
73 | NL_BIT( 68, T_MAY_IGNORE, resize_force) | 73 | NL_BIT( 68, T_MAY_IGNORE, resize_force) |
74 | NL_BIT( 69, T_MANDATORY, no_resync) | ||
74 | ) | 75 | ) |
75 | 76 | ||
76 | NL_PACKET(syncer_conf, 8, | 77 | NL_PACKET(syncer_conf, 8, |