common/buffer: off-by-one error in max iov length blocking

The loop in write_fd stops at IOV_MAX-1; it could go to IOV_MAX
and write in more-natural sizes without extra tail writes.

Fixes: http://tracker.ceph.com/issues/20907
Signed-off-by: Dan Mick <dan.mick@redhat.com>
This commit is contained in:
Dan Mick 2017-08-03 18:22:47 -07:00
parent d89af4a3e8
commit 89f85d22c1

View File

@ -2382,7 +2382,7 @@ int buffer::list::write_fd(int fd) const
}
++p;
if (iovlen == IOV_MAX-1 ||
if (iovlen == IOV_MAX ||
p == _buffers.end()) {
iovec *start = iov;
int num = iovlen;