From 89f85d22c1f9eee34ee5a36f8071137023a56f06 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 3 Aug 2017 18:22:47 -0700 Subject: [PATCH] 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 --- src/common/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 4b75b9b6317..b8e87d1eea3 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; -- 2.47.3