diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2012-07-26 08:09:49 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 08:05:32 -0500 |
commit | 58ffa580a748dd16b1e5ab260bea39cdbd1e94ef (patch) | |
tree | 4155bcde6d49f50545bcb1312b6470c64e823d72 /drivers/block/drbd/drbd_nl.c | |
parent | 970fbde1f1ebae0c85bbaed3de83684a58d60fad (diff) |
drbd: introduce stop-sector to online verify
We now can schedule only a specific range of sectors for online verify,
or interrupt a running verify without interrupting the connection.
Had to bump the protocol version differently, we are now 101.
Added verify_can_do_stop_sector() { protocol >= 97 && protocol != 100; }
Also, the return value convention for worker callbacks has changed,
we returned "true/false" for "keep the connection up" in 8.3,
we return 0 for success and <= for failure in 8.4.
Affected: receive_state()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 4afd626ca3dc..eefb56308aea 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -2939,6 +2939,7 @@ int drbd_adm_start_ov(struct sk_buff *skb, struct genl_info *info) | |||
2939 | { | 2939 | { |
2940 | struct drbd_conf *mdev; | 2940 | struct drbd_conf *mdev; |
2941 | enum drbd_ret_code retcode; | 2941 | enum drbd_ret_code retcode; |
2942 | struct start_ov_parms parms; | ||
2942 | 2943 | ||
2943 | retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_MINOR); | 2944 | retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_MINOR); |
2944 | if (!adm_ctx.reply_skb) | 2945 | if (!adm_ctx.reply_skb) |
@@ -2947,19 +2948,22 @@ int drbd_adm_start_ov(struct sk_buff *skb, struct genl_info *info) | |||
2947 | goto out; | 2948 | goto out; |
2948 | 2949 | ||
2949 | mdev = adm_ctx.mdev; | 2950 | mdev = adm_ctx.mdev; |
2951 | |||
2952 | /* resume from last known position, if possible */ | ||
2953 | parms.ov_start_sector = mdev->ov_start_sector; | ||
2954 | parms.ov_stop_sector = ULLONG_MAX; | ||
2950 | if (info->attrs[DRBD_NLA_START_OV_PARMS]) { | 2955 | if (info->attrs[DRBD_NLA_START_OV_PARMS]) { |
2951 | /* resume from last known position, if possible */ | ||
2952 | struct start_ov_parms parms = | ||
2953 | { .ov_start_sector = mdev->ov_start_sector }; | ||
2954 | int err = start_ov_parms_from_attrs(&parms, info); | 2956 | int err = start_ov_parms_from_attrs(&parms, info); |
2955 | if (err) { | 2957 | if (err) { |
2956 | retcode = ERR_MANDATORY_TAG; | 2958 | retcode = ERR_MANDATORY_TAG; |
2957 | drbd_msg_put_info(from_attrs_err_to_txt(err)); | 2959 | drbd_msg_put_info(from_attrs_err_to_txt(err)); |
2958 | goto out; | 2960 | goto out; |
2959 | } | 2961 | } |
2960 | /* w_make_ov_request expects position to be aligned */ | ||
2961 | mdev->ov_start_sector = parms.ov_start_sector & ~BM_SECT_PER_BIT; | ||
2962 | } | 2962 | } |
2963 | /* w_make_ov_request expects position to be aligned */ | ||
2964 | mdev->ov_start_sector = parms.ov_start_sector & ~(BM_SECT_PER_BIT-1); | ||
2965 | mdev->ov_stop_sector = parms.ov_stop_sector; | ||
2966 | |||
2963 | /* If there is still bitmap IO pending, e.g. previous resync or verify | 2967 | /* If there is still bitmap IO pending, e.g. previous resync or verify |
2964 | * just being finished, wait for it before requesting a new resync. */ | 2968 | * just being finished, wait for it before requesting a new resync. */ |
2965 | drbd_suspend_io(mdev); | 2969 | drbd_suspend_io(mdev); |