Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213122
b: refs/heads/master
c: c36c3ce
h: refs/heads/master
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Oct 14, 2010
1 parent 7a399bd commit e05525c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 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: 85719573dd716bc2ac3e098b44adfed884250bab
refs/heads/master: c36c3ced692b38d0cf90a5e6f875be2f9ebbc037
4 changes: 4 additions & 0 deletions trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,16 @@ enum {
* if any of those fail, we set this flag atomically
* from the endio callback */
__EE_WAS_ERROR,

/* This ee has a pointer to a digest instead of a block id */
__EE_HAS_DIGEST,
};
#define EE_CALL_AL_COMPLETE_IO (1<<__EE_CALL_AL_COMPLETE_IO)
#define EE_MAY_SET_IN_SYNC (1<<__EE_MAY_SET_IN_SYNC)
#define EE_IS_BARRIER (1<<__EE_IS_BARRIER)
#define EE_RESUBMITTED (1<<__EE_RESUBMITTED)
#define EE_WAS_ERROR (1<<__EE_WAS_ERROR)
#define EE_HAS_DIGEST (1<<__EE_HAS_DIGEST)

/* global flag bits */
enum {
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev,

void drbd_free_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e)
{
if (e->flags & EE_HAS_DIGEST)
kfree(e->digest);
drbd_pp_free(mdev, e->pages);
D_ASSERT(atomic_read(&e->pending_bios) == 0);
D_ASSERT(hlist_unhashed(&e->colision));
Expand Down Expand Up @@ -2094,10 +2096,12 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h)
di->digest_size = digest_size;
di->digest = (((char *)di)+sizeof(struct digest_info));

e->digest = di;
e->flags |= EE_HAS_DIGEST;

if (drbd_recv(mdev, di->digest, digest_size) != digest_size)
goto out_free_e;

e->digest = di;
if (h->command == P_CSUM_RS_REQUEST) {
D_ASSERT(mdev->agreed_pro_version >= 89);
e->w.cb = w_e_end_csum_rs_req;
Expand Down Expand Up @@ -2159,7 +2163,6 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h)
return TRUE;

out_free_e:
kfree(di);
put_ldev(mdev);
drbd_free_ee(mdev, e);
return FALSE;
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,6 @@ int w_e_end_csum_rs_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
}

dec_unacked(mdev);

kfree(di);

move_to_net_ee_or_free(mdev, e);

if (unlikely(!ok))
Expand Down Expand Up @@ -1145,9 +1142,6 @@ int w_e_end_ov_reply(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
}

dec_unacked(mdev);

kfree(di);

if (!eq)
drbd_ov_oos_found(mdev, e->sector, e->size);
else
Expand Down

0 comments on commit e05525c

Please sign in to comment.