Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242805
b: refs/heads/master
c: 30b743a
h: refs/heads/master
i:
  242803: 3c052ec
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Mar 10, 2011
1 parent 12e7a6f commit ab6c099
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 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: 26525618863afcc4aab8b2a83451d37c6f513460
refs/heads/master: 30b743a2d532af39c9ed13c85d5473f6f620f6c8
23 changes: 12 additions & 11 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,10 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
/* helper for __drbd_set_state */
static void set_ov_position(struct drbd_conf *mdev, enum drbd_conns cs)
{
if (mdev->agreed_pro_version < 90)
mdev->ov_start_sector = 0;
mdev->rs_total = drbd_bm_bits(mdev);
mdev->ov_position = 0;
if (cs == C_VERIFY_T) {
/* starting online verify from an arbitrary position
* does not fit well into the existing protocol.
Expand All @@ -970,11 +974,15 @@ static void set_ov_position(struct drbd_conf *mdev, enum drbd_conns cs)
mdev->ov_start_sector = ~(sector_t)0;
} else {
unsigned long bit = BM_SECT_TO_BIT(mdev->ov_start_sector);
if (bit >= mdev->rs_total)
if (bit >= mdev->rs_total) {
mdev->ov_start_sector =
BM_BIT_TO_SECT(mdev->rs_total - 1);
mdev->rs_total = 1;
} else
mdev->rs_total -= bit;
mdev->ov_position = mdev->ov_start_sector;
}
mdev->ov_left = mdev->rs_total;
}

static void drbd_resume_al(struct drbd_conf *mdev)
Expand Down Expand Up @@ -1081,7 +1089,7 @@ int __drbd_set_state(struct drbd_conf *mdev,
if ((os.conn == C_VERIFY_S || os.conn == C_VERIFY_T) &&
ns.conn < C_CONNECTED) {
mdev->ov_start_sector =
BM_BIT_TO_SECT(mdev->rs_total - mdev->ov_left);
BM_BIT_TO_SECT(drbd_bm_bits(mdev) - mdev->ov_left);
dev_info(DEV, "Online Verify reached sector %llu\n",
(unsigned long long)mdev->ov_start_sector);
}
Expand All @@ -1106,22 +1114,15 @@ int __drbd_set_state(struct drbd_conf *mdev,
unsigned long now = jiffies;
int i;

mdev->ov_position = 0;
mdev->rs_total = drbd_bm_bits(mdev);
if (mdev->agreed_pro_version >= 90)
set_ov_position(mdev, ns.conn);
else
mdev->ov_start_sector = 0;
mdev->ov_left = mdev->rs_total
- BM_SECT_TO_BIT(mdev->ov_position);
set_ov_position(mdev, ns.conn);
mdev->rs_start = now;
mdev->rs_last_events = 0;
mdev->rs_last_sect_ev = 0;
mdev->ov_last_oos_size = 0;
mdev->ov_last_oos_start = 0;

for (i = 0; i < DRBD_SYNC_MARKS; i++) {
mdev->rs_mark_left[i] = mdev->rs_total;
mdev->rs_mark_left[i] = mdev->ov_left;
mdev->rs_mark_time[i] = now;
}

Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/block/drbd/drbd_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,13 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
mdev->state.conn == C_SYNC_TARGET)
drbd_syncer_progress(mdev, seq);

if (mdev->state.conn == C_VERIFY_S || mdev->state.conn == C_VERIFY_T)
if (mdev->state.conn == C_VERIFY_S || mdev->state.conn == C_VERIFY_T) {
unsigned long bm_bits = drbd_bm_bits(mdev);
seq_printf(seq, "\t%3d%% %lu/%lu\n",
(int)((mdev->rs_total-mdev->ov_left) /
(mdev->rs_total/100+1)),
mdev->rs_total - mdev->ov_left,
mdev->rs_total);
(int)((bm_bits-mdev->ov_left) /
(bm_bits/100+1)),
bm_bits - mdev->ov_left, bm_bits);
}

if (proc_details >= 1 && get_ldev_if_state(mdev, D_FAILED)) {
lc_seq_printf_stats(seq, mdev->resync);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,8 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
mdev->agreed_pro_version >= 90) {
mdev->ov_start_sector = sector;
mdev->ov_position = sector;
mdev->ov_left = mdev->rs_total - BM_SECT_TO_BIT(sector);
mdev->ov_left = drbd_bm_bits(mdev) - BM_SECT_TO_BIT(sector);
mdev->rs_total = mdev->ov_left;
dev_info(DEV, "Online Verify start sector: %llu\n",
(unsigned long long)sector);
}
Expand Down

0 comments on commit ab6c099

Please sign in to comment.