From 6e94f695c4cb8aabc57b5ef00073c2301fec409a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 16 Feb 2015 13:26:29 +0000 Subject: [PATCH] iov_buf: Add an explaining comment Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/util/iov_buf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/util/iov_buf.c b/lib/util/iov_buf.c index 82a4af5323b..d260b2fea86 100644 --- a/lib/util/iov_buf.c +++ b/lib/util/iov_buf.c @@ -75,6 +75,10 @@ bool iov_advance(struct iovec **iov, int *iovcnt, size_t n) /* * Skip 0-length iovec's + * + * There might be empty buffers at the end of iov. Next time we do a + * readv/writev based on this iov would give 0 transferred bytes, also + * known as EPIPE. So we need to be careful discarding them. */ while ((cnt > 0) && (v->iov_len == 0)) { -- 2.11.4.GIT