Skip to content

Commit

Permalink
drbd: recv_resync_read(): Return 0 upon success and an error code oth…
Browse files Browse the repository at this point in the history
…erwise

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 Nov 8, 2012
1 parent 28284ce commit e1c1b0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si

atomic_add(data_size >> 9, &mdev->rs_sect_ev);
if (drbd_submit_peer_request(mdev, peer_req, WRITE, DRBD_FAULT_RS_WR) == 0)
return true;
return 0;

/* don't care for the reason here */
dev_err(DEV, "submit failed, triggering re-connect\n");
Expand All @@ -1526,7 +1526,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si
drbd_free_ee(mdev, peer_req);
fail:
put_ldev(mdev);
return false;
return -EIO;
}

static struct drbd_request *
Expand Down Expand Up @@ -1590,7 +1590,7 @@ static int receive_RSDataReply(struct drbd_conf *mdev, enum drbd_packet cmd,
/* data is submitted to disk within recv_resync_read.
* corresponding put_ldev done below on error,
* or in drbd_peer_request_endio. */
ok = recv_resync_read(mdev, sector, data_size);
ok = !recv_resync_read(mdev, sector, data_size);
} else {
if (__ratelimit(&drbd_ratelimit_state))
dev_err(DEV, "Can not write resync data to local disk.\n");
Expand Down

0 comments on commit e1c1b0f

Please sign in to comment.