Commit e1c1b0fc authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: recv_resync_read(): Return 0 upon success and an error code otherwise

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 28284cef
...@@ -1515,7 +1515,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si ...@@ -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); atomic_add(data_size >> 9, &mdev->rs_sect_ev);
if (drbd_submit_peer_request(mdev, peer_req, WRITE, DRBD_FAULT_RS_WR) == 0) 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 */ /* don't care for the reason here */
dev_err(DEV, "submit failed, triggering re-connect\n"); dev_err(DEV, "submit failed, triggering re-connect\n");
...@@ -1526,7 +1526,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si ...@@ -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); drbd_free_ee(mdev, peer_req);
fail: fail:
put_ldev(mdev); put_ldev(mdev);
return false; return -EIO;
} }
static struct drbd_request * static struct drbd_request *
...@@ -1590,7 +1590,7 @@ static int receive_RSDataReply(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -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. /* data is submitted to disk within recv_resync_read.
* corresponding put_ldev done below on error, * corresponding put_ldev done below on error,
* or in drbd_peer_request_endio. */ * or in drbd_peer_request_endio. */
ok = recv_resync_read(mdev, sector, data_size); ok = !recv_resync_read(mdev, sector, data_size);
} else { } else {
if (__ratelimit(&drbd_ratelimit_state)) if (__ratelimit(&drbd_ratelimit_state))
dev_err(DEV, "Can not write resync data to local disk.\n"); dev_err(DEV, "Can not write resync data to local disk.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment