From: Dan Mick Date: Fri, 4 Aug 2017 01:22:47 +0000 (-0700) Subject: common/buffer: off-by-one error in max iov length blocking X-Git-Tag: v12.1.3~89^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89f85d22c1f9eee34ee5a36f8071137023a56f06;p=ceph.git 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 --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 4b75b9b63179..b8e87d1eea3d 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -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;