diff options
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/messenger.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 575511a29eb7..e8f236e87f38 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -747,17 +747,18 @@ static int write_partial_kvec(struct ceph_connection *con) | |||
747 | con->out_kvec_bytes -= ret; | 747 | con->out_kvec_bytes -= ret; |
748 | if (con->out_kvec_bytes == 0) | 748 | if (con->out_kvec_bytes == 0) |
749 | break; /* done */ | 749 | break; /* done */ |
750 | while (ret > 0) { | 750 | |
751 | if (ret >= con->out_kvec_cur->iov_len) { | 751 | /* account for full iov entries consumed */ |
752 | ret -= con->out_kvec_cur->iov_len; | 752 | while (ret >= con->out_kvec_cur->iov_len) { |
753 | con->out_kvec_cur++; | 753 | BUG_ON(!con->out_kvec_left); |
754 | con->out_kvec_left--; | 754 | ret -= con->out_kvec_cur->iov_len; |
755 | } else { | 755 | con->out_kvec_cur++; |
756 | con->out_kvec_cur->iov_len -= ret; | 756 | con->out_kvec_left--; |
757 | con->out_kvec_cur->iov_base += ret; | 757 | } |
758 | ret = 0; | 758 | /* and for a partially-consumed entry */ |
759 | break; | 759 | if (ret) { |
760 | } | 760 | con->out_kvec_cur->iov_len -= ret; |
761 | con->out_kvec_cur->iov_base += ret; | ||
761 | } | 762 | } |
762 | } | 763 | } |
763 | con->out_kvec_left = 0; | 764 | con->out_kvec_left = 0; |