Thread (17 messages) 17 messages, 7 authors, 2013-11-29
STALE4574d

[PATCH] pipe_to_sendpage: Ensure that MSG_MORE is set if we set MSG_SENDPAGE_NOTLAST

From: Richard Weinberger <richard@nod.at>
Date: 2013-11-24 23:42:07
Also in: linux-crypto, linux-fsdevel, lkml, stable
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

Commit 35f9c09fe (tcp: tcp_sendpages() should call tcp_push() once)
added an internal flag MSG_SENDPAGE_NOTLAST.
We have to ensure that MSG_MORE is also set if we set MSG_SENDPAGE_NOTLAST.
Otherwise users that check against MSG_MORE will not see it.

This fixes sendfile() on AF_ALG.

Cc: Tom Herbert <redacted>
Cc: Eric Dumazet <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: <redacted> # 3.4.x
Reported-and-tested-by: Shawn Landden <redacted>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/splice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/splice.c b/fs/splice.c
index 3b7ee65..b93f1b8 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -701,7 +701,7 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
 	more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
 
 	if (sd->len < sd->total_len && pipe->nrbufs > 1)
-		more |= MSG_SENDPAGE_NOTLAST;
+		more |= MSG_SENDPAGE_NOTLAST | MSG_MORE;
 
 	return file->f_op->sendpage(file, buf->page, buf->offset,
 				    sd->len, &pos, more);
-- 
1.8.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help