Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345703
b: refs/heads/master
c: 579b57e
h: refs/heads/master
i:
  345701: e70b82e
  345699: 563e962
  345695: b62eb19
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Aug 25, 2011
1 parent 554fa58 commit d0ab2d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 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: e7fad8af750c5780143e4b6876f80042ec0c21f5
refs/heads/master: 579b57ed730819970a3542b4bbcc2d4176f25c72
9 changes: 1 addition & 8 deletions trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,10 @@ extern char usermode_helper[];
*/
#define DRBD_SIGKILL SIGHUP

/* All EEs on the free list should have ID_VACANT (== 0)
* freshly allocated EEs get !ID_VACANT (== 1)
* so if it says "cannot dereference null pointer at address 0x00000001",
* it is most likely one of these :( */

#define ID_IN_SYNC (4711ULL)
#define ID_OUT_OF_SYNC (4712ULL)

#define ID_SYNCER (-1ULL)
#define ID_VACANT 0
#define is_syncer_block_id(id) ((id) == ID_SYNCER)

#define UUID_NEW_BM_OFFSET ((u64)0x0001000000000000ULL)

struct drbd_conf;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4308,7 +4308,7 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h)

update_peer_seq(mdev, be32_to_cpu(p->seq_num));

if (is_syncer_block_id(p->block_id)) {
if (p->block_id == ID_SYNCER) {
drbd_set_in_sync(mdev, sector, blksize);
dec_rs_pending(mdev);
return true;
Expand Down Expand Up @@ -4349,7 +4349,7 @@ static int got_NegAck(struct drbd_conf *mdev, struct p_header80 *h)

update_peer_seq(mdev, be32_to_cpu(p->seq_num));

if (is_syncer_block_id(p->block_id)) {
if (p->block_id == ID_SYNCER) {
dec_rs_pending(mdev);
drbd_rs_failed_io(mdev, sector, size);
return true;
Expand Down
14 changes: 4 additions & 10 deletions trunk/drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ void drbd_endio_read_sec_final(struct drbd_epoch_entry *e) __releases(local)
unsigned long flags = 0;
struct drbd_conf *mdev = e->mdev;

D_ASSERT(e->block_id != ID_VACANT);

spin_lock_irqsave(&mdev->req_lock, flags);
mdev->read_cnt += e->size >> 9;
list_del(&e->w.list);
Expand All @@ -108,18 +106,16 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo
struct drbd_conf *mdev = e->mdev;
sector_t e_sector;
int do_wake;
int is_syncer_req;
u64 block_id;
int do_al_complete_io;

D_ASSERT(e->block_id != ID_VACANT);

/* after we moved e to done_ee,
* we may no longer access it,
* it may be freed/reused already!
* (as soon as we release the req_lock) */
e_sector = e->sector;
do_al_complete_io = e->flags & EE_CALL_AL_COMPLETE_IO;
is_syncer_req = is_syncer_block_id(e->block_id);
block_id = e->block_id;

spin_lock_irqsave(&mdev->req_lock, flags);
mdev->writ_cnt += e->size >> 9;
Expand All @@ -131,15 +127,13 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo
* done from "drbd_process_done_ee" within the appropriate w.cb
* (e_end_block/e_end_resync_block) or from _drbd_clear_done_ee */

do_wake = is_syncer_req
? list_empty(&mdev->sync_ee)
: list_empty(&mdev->active_ee);
do_wake = list_empty(block_id == ID_SYNCER ? &mdev->sync_ee : &mdev->active_ee);

if (test_bit(__EE_WAS_ERROR, &e->flags))
__drbd_chk_io_error(mdev, false);
spin_unlock_irqrestore(&mdev->req_lock, flags);

if (is_syncer_req)
if (block_id == ID_SYNCER)
drbd_rs_complete_io(mdev, e_sector);

if (do_wake)
Expand Down

0 comments on commit d0ab2d3

Please sign in to comment.