diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-23 22:24:55 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-23 22:24:55 +0300 |
commit | 7c98a42618271210c60b79128b220107d35938d9 (patch) | |
tree | 79ae0c1ca1b98b94f700d28cd6cb50fc80d866ff /net | |
parent | 3381918fec9278d14f776d1dabd68da85fd6822e (diff) | |
parent | 7e241f647dc7087a0401418a187f3f5b527cc690 (diff) | |
download | linux-7c98a42618271210c60b79128b220107d35938d9.tar.xz |
Merge tag 'ceph-for-4.20-rc4' of https://github.com/ceph/ceph-client
Pullk ceph fix from Ilya Dryomov:
"A messenger fix, marked for stable"
* tag 'ceph-for-4.20-rc4' of https://github.com/ceph/ceph-client:
libceph: fall back to sendmsg for slab pages
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 57fcc6b4bf6e..2f126eff275d 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -580,9 +580,15 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page, struct bio_vec bvec; int ret; - /* sendpage cannot properly handle pages with page_count == 0, - * we need to fallback to sendmsg if that's the case */ - if (page_count(page) >= 1) + /* + * sendpage cannot properly handle pages with page_count == 0, + * we need to fall back to sendmsg if that's the case. + * + * Same goes for slab pages: skb_can_coalesce() allows + * coalescing neighboring slab objects into a single frag which + * 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; |