Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196849
b: refs/heads/master
c: 6495d2c
h: refs/heads/master
i:
  196847: a3134eb
v: v3
  • Loading branch information
Philipp Reisner committed May 17, 2010
1 parent 8f8b38f commit 393047f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4ee79dac3bddc468e21cae0deb00b80ec4ac051
refs/heads/master: 6495d2c6d04f4c45411fdb1b40527c24015f39d6
11 changes: 9 additions & 2 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
int retcode = NO_ERROR;
int ldsc = 0; /* local disk size changed */
enum determine_dev_size dd;
enum dds_flags ddsf;

memset(&rs, 0, sizeof(struct resize));
if (!resize_from_tags(mdev, nlp->tag_list, &rs)) {
Expand All @@ -1502,13 +1503,19 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
goto fail;
}

if (rs.no_resync && mdev->agreed_pro_version < 93) {
retcode = ERR_NEED_APV_93;
goto fail;
}

if (mdev->ldev->known_size != drbd_get_capacity(mdev->ldev->backing_bdev)) {
mdev->ldev->known_size = drbd_get_capacity(mdev->ldev->backing_bdev);
ldsc = 1;
}

mdev->ldev->dc.disk_size = (sector_t)rs.resize_size;
dd = drbd_determin_dev_size(mdev, rs.resize_force ? DDSF_FORCED : 0);
ddsf = (rs.resize_force ? DDSF_FORCED : 0) | (rs.no_resync ? DDSF_NO_RESYNC : 0);
dd = drbd_determin_dev_size(mdev, ddsf);
drbd_md_sync(mdev);
put_ldev(mdev);
if (dd == dev_size_error) {
Expand All @@ -1521,7 +1528,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
set_bit(RESIZE_PENDING, &mdev->flags);

drbd_send_uuids(mdev);
drbd_send_sizes(mdev, 1, 0);
drbd_send_sizes(mdev, 1, ddsf);
}

fail:
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/drbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern const char *drbd_buildtag(void);
#define REL_VERSION "8.3.7"
#define API_VERSION 88
#define PRO_VERSION_MIN 86
#define PRO_VERSION_MAX 92
#define PRO_VERSION_MAX 93


enum drbd_io_error_p {
Expand Down Expand Up @@ -139,6 +139,7 @@ enum drbd_ret_codes {
ERR_DATA_NOT_CURRENT = 150,
ERR_CONNECTED = 151, /* DRBD 8.3 only */
ERR_PERM = 152,
ERR_NEED_APV_93 = 153,

/* insert new ones above this line */
AFTER_LAST_ERR_CODE
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/drbd_nl.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ NL_PACKET(disconnect, 6, )
NL_PACKET(resize, 7,
NL_INT64( 29, T_MAY_IGNORE, resize_size)
NL_BIT( 68, T_MAY_IGNORE, resize_force)
NL_BIT( 69, T_MANDATORY, no_resync)
)

NL_PACKET(syncer_conf, 8,
Expand Down

0 comments on commit 393047f

Please sign in to comment.