Skip to content

Commit

Permalink
drbd: Consistently use block_id == ID_SYNCER for checksum based resyn…
Browse files Browse the repository at this point in the history
…c and online verify

DRBD_MAGIC has nothing to do with block ids and the funny values
computed were not actually used, anyway.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Aug 25, 2011
1 parent 3980485 commit 9a8e775
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ int drbd_send_drequest_csum(struct drbd_conf *mdev,
struct p_block_req p;

p.sector = cpu_to_be64(sector);
p.block_id = BE_DRBD_MAGIC + 0xbeef;
p.block_id = ID_SYNCER /* unused */;
p.blksize = cpu_to_be32(size);

p.head.magic = BE_DRBD_MAGIC;
Expand All @@ -2497,7 +2497,7 @@ int drbd_send_ov_request(struct drbd_conf *mdev, sector_t sector, int size)
struct p_block_req p;

p.sector = cpu_to_be64(sector);
p.block_id = BE_DRBD_MAGIC + 0xbabe;
p.block_id = ID_SYNCER /* unused */;
p.blksize = cpu_to_be32(size);

ok = drbd_send_cmd(mdev, USE_DATA_SOCKET, P_OV_REQUEST,
Expand Down
4 changes: 4 additions & 0 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev,
e->size = data_size;
e->flags = 0;
e->sector = sector;
/*
* The block_id is opaque to the receiver. It is not endianness
* converted, and sent back to the sender unchanged.
*/
e->block_id = id;

return e;
Expand Down
4 changes: 1 addition & 3 deletions drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ int w_e_send_csum(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
void *digest;
int ok = 1;

D_ASSERT(e->block_id == DRBD_MAGIC + 0xbeef);

if (unlikely(cancel))
goto out;

Expand Down Expand Up @@ -359,7 +357,7 @@ static int read_for_csum(struct drbd_conf *mdev, sector_t sector, int size)

/* GFP_TRY, because if there is no memory available right now, this may
* be rescheduled for later. It is "only" background resync, after all. */
e = drbd_alloc_ee(mdev, DRBD_MAGIC+0xbeef, sector, size, GFP_TRY);
e = drbd_alloc_ee(mdev, ID_SYNCER /* unused */, sector, size, GFP_TRY);
if (!e)
goto defer;

Expand Down

0 comments on commit 9a8e775

Please sign in to comment.