]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/buffer: off-by-one error in max iov length blocking 16803/head
authorDan Mick <dan.mick@redhat.com>
Fri, 4 Aug 2017 01:22:47 +0000 (18:22 -0700)
committerDan Mick <dan.mick@redhat.com>
Fri, 4 Aug 2017 01:25:00 +0000 (18:25 -0700)
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>
src/common/buffer.cc

index 4b75b9b631791c5e1e8f01cf393bd292516a1f74..b8e87d1eea3dc16b9908cc163f937d0ffd4ffe3b 100644 (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;