Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242882
b: refs/heads/master
c: 617049a
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Reisner committed Mar 10, 2011
1 parent f55a8f6 commit 406db17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 071942727824bab03b1a3f6b6eeb5b269697b333
refs/heads/master: 617049aa7d753e8c821ac77126ab90e9f1b66d6d
21 changes: 21 additions & 0 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,24 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
drbd_force_state(mdev, NS(conn, C_PROTOCOL_ERROR));
}


/* In C_AHEAD mode only out_of_sync packets are sent for requests. Detach
* those requests from the newsest barrier when changing to an other cstate.
*
* That headless list vanishes when the last request finished its write or
* send out_of_sync packet. */
static void tl_forget(struct drbd_conf *mdev)
{
struct drbd_tl_epoch *b;

if (test_bit(CREATE_BARRIER, &mdev->flags))
return;

b = mdev->newest_tle;
list_del(&b->requests);
_tl_add_barrier(mdev, b);
}

/**
* _tl_restart() - Walks the transfer log, and applies an action to all requests
* @mdev: DRBD device.
Expand Down Expand Up @@ -1242,6 +1260,9 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns,
if (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED)
drbd_resume_al(mdev);

if (os.conn == C_AHEAD && ns.conn != C_AHEAD)
tl_forget(mdev);

ascw = kmalloc(sizeof(*ascw), GFP_ATOMIC);
if (ascw) {
ascw->os = os;
Expand Down

0 comments on commit 406db17

Please sign in to comment.