Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-01-16 16:12:01 +0000
committerLuis Henriques <lhenriques@suse.com>2019-01-18 11:21:09 +0000
commitaab550edd4b32288ed3ea2bae60bbb32fb0e37d1 (patch)
tree10cef8ce918185267848d7ca1a8c10bcfc0601f7
parent1a6b0c5329b9e4d104ab1623cb8f6b5cb2fccc06 (diff)
libceph: use sock_no_sendpage() as a fallback in
ceph_tcp_sendpage() (bsc#1122215).
-rw-r--r--patches.suse/libceph-use-sock_no_sendpage-as-a-fallback-in-ceph_tcp_sendpage.patch72
-rw-r--r--series.conf1
2 files changed, 73 insertions, 0 deletions
diff --git a/patches.suse/libceph-use-sock_no_sendpage-as-a-fallback-in-ceph_tcp_sendpage.patch b/patches.suse/libceph-use-sock_no_sendpage-as-a-fallback-in-ceph_tcp_sendpage.patch
new file mode 100644
index 0000000000..ff6924f1a5
--- /dev/null
+++ b/patches.suse/libceph-use-sock_no_sendpage-as-a-fallback-in-ceph_tcp_sendpage.patch
@@ -0,0 +1,72 @@
+From: Ilya Dryomov <idryomov@gmail.com>
+Date: Fri, 16 Nov 2018 11:58:19 +0100
+Subject: libceph: use sock_no_sendpage() as a fallback in ceph_tcp_sendpage()
+Git-commit: 3239eb5215ebdef593a79316c9dbbdf8849166ec
+Patch-mainline: v5.0-rc1
+References: bsc#1122215
+
+sock_no_sendpage() makes the code cleaner.
+
+Also, don't set MSG_EOR. sendpage doesn't act on MSG_EOR on its own,
+it just honors the setting from the preceding sendmsg call by looking
+at ->eor in tcp_skb_can_collapse_to().
+
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Acked-by: Luis Henriques <lhenriques@suse.com>
+---
+ net/ceph/messenger.c | 32 ++++++--------------------------
+ 1 file changed, 6 insertions(+), 26 deletions(-)
+
+--- a/net/ceph/messenger.c
++++ b/net/ceph/messenger.c
+@@ -572,24 +572,12 @@ static int ceph_tcp_sendmsg(struct socke
+ return r;
+ }
+
+-static int __ceph_tcp_sendpage(struct socket *sock, struct page *page,
+- int offset, size_t size, bool more)
+-{
+- int flags = MSG_DONTWAIT | MSG_NOSIGNAL | (more ? MSG_MORE : MSG_EOR);
+- int ret;
+-
+- ret = kernel_sendpage(sock, page, offset, size, flags);
+- if (ret == -EAGAIN)
+- ret = 0;
+-
+- return ret;
+-}
+-
+ static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
+ int offset, size_t size, bool more)
+ {
+- struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL };
+- struct bio_vec bvec;
++ ssize_t (*sendpage)(struct socket *sock, struct page *page,
++ int offset, size_t size, int flags);
++ int flags = MSG_DONTWAIT | MSG_NOSIGNAL | (more ? MSG_MORE : 0);
+ int ret;
+
+ /*
+@@ -601,19 +589,11 @@ static int ceph_tcp_sendpage(struct sock
+ * triggers one of hardened usercopy checks.
+ */
+ if (page_count(page) >= 1 && !PageSlab(page))
+- return __ceph_tcp_sendpage(sock, page, offset, size, more);
+-
+- bvec.bv_page = page;
+- bvec.bv_offset = offset;
+- bvec.bv_len = size;
+-
+- if (more)
+- msg.msg_flags |= MSG_MORE;
++ sendpage = sock->ops->sendpage;
+ else
+- msg.msg_flags |= MSG_EOR; /* superfluous, but what the hell */
++ sendpage = sock_no_sendpage;
+
+- iov_iter_bvec(&msg.msg_iter, WRITE | ITER_BVEC, &bvec, 1, size);
+- ret = sock_sendmsg(sock, &msg);
++ ret = sendpage(sock, page, offset, size, flags);
+ if (ret == -EAGAIN)
+ ret = 0;
+
diff --git a/series.conf b/series.conf
index daee04e8ee..77ada213d2 100644
--- a/series.conf
+++ b/series.conf
@@ -42495,6 +42495,7 @@
patches.suse/ceph-cleanup-splice_dentry.patch
patches.suse/ceph-remove-redundant-assignment.patch
patches.suse/libceph-drop-last_piece-logic-from-write_partial_message_data.patch
+ patches.suse/libceph-use-sock_no_sendpage-as-a-fallback-in-ceph_tcp_sendpage.patch
patches.fixes/ceph-don-t-update-importing-cap-s-mseq-when-handing-cap-export.patch
patches.fixes/xfs-xfs_buf-drop-useless-LIST_HEAD.patch
patches.drivers/thermal-bcm2835-enable-hwmon-explicitly.patch