net/smc: Cork when sendpage with MSG_SENDPAGE_NOTLAST flag
mainline inclusion from mainline-v5.18-rc1 commit be9a16cc category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I78OQ2 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/smc?id=be9a16cccaefac23cb16909e04bb65e62e09d515 -------------------------------- This introduces a new corked flag, MSG_SENDPAGE_NOTLAST, which is involved in syscall sendfile() [1], it indicates this is not the last page. So we can cork the data until the page is not specify this flag. It has the same effect as MSG_MORE, but existed in sendfile() only. This patch adds a option MSG_SENDPAGE_NOTLAST for corking data, try to cork more data before sending when using sendfile(), which acts like TCP's behaviour. Also, this reimplements the default sendpage to inform that it is supported to some extent. [1] https://man7.org/linux/man-pages/man2/sendfile.2.html Signed-off-by:Tony Lu <tonylu@linux.alibaba.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Litao Jiao <jiaolitao@sangfor.com.cn>
Loading
Please sign in to comment