提交 a982dd57 编写于 作者: A Andreas Gruenbacher 提交者: Philipp Reisner

drbd: send_bitmap_rle_or_plain(): Error handling cleanup

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 e1c1b0fc
...@@ -1123,8 +1123,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev, ...@@ -1123,8 +1123,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev,
{ {
struct p_compressed_bm *p = (void*)h; struct p_compressed_bm *p = (void*)h;
unsigned long num_words; unsigned long num_words;
int len; int len, err;
int ok;
len = fill_bitmap_rle_bits(mdev, p, c); len = fill_bitmap_rle_bits(mdev, p, c);
...@@ -1133,7 +1132,8 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev, ...@@ -1133,7 +1132,8 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev,
if (len) { if (len) {
DCBP_set_code(p, RLE_VLI_Bits); DCBP_set_code(p, RLE_VLI_Bits);
ok = !_drbd_send_cmd(mdev, mdev->tconn->data.socket, P_COMPRESSED_BITMAP, h, err = _drbd_send_cmd(mdev, mdev->tconn->data.socket,
P_COMPRESSED_BITMAP, h,
sizeof(*p) + len, 0); sizeof(*p) + len, 0);
c->packets[0]++; c->packets[0]++;
...@@ -1148,7 +1148,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev, ...@@ -1148,7 +1148,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev,
len = num_words * sizeof(long); len = num_words * sizeof(long);
if (len) if (len)
drbd_bm_get_lel(mdev, c->word_offset, num_words, (unsigned long*)h->payload); drbd_bm_get_lel(mdev, c->word_offset, num_words, (unsigned long*)h->payload);
ok = !_drbd_send_cmd(mdev, mdev->tconn->data.socket, P_BITMAP, err = _drbd_send_cmd(mdev, mdev->tconn->data.socket, P_BITMAP,
h, sizeof(struct p_header80) + len, 0); h, sizeof(struct p_header80) + len, 0);
c->word_offset += num_words; c->word_offset += num_words;
c->bit_offset = c->word_offset * BITS_PER_LONG; c->bit_offset = c->word_offset * BITS_PER_LONG;
...@@ -1159,7 +1159,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev, ...@@ -1159,7 +1159,7 @@ send_bitmap_rle_or_plain(struct drbd_conf *mdev,
if (c->bit_offset > c->bm_bits) if (c->bit_offset > c->bm_bits)
c->bit_offset = c->bm_bits; c->bit_offset = c->bm_bits;
} }
if (ok) { if (!err) {
if (len == 0) { if (len == 0) {
INFO_bm_xfer_stats(mdev, "send", c); INFO_bm_xfer_stats(mdev, "send", c);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册