Skip to content

Commit

Permalink
Merge tag 'ceph-for-4.20-rc4' of https://github.com/ceph/ceph-client
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 23, 2018
2 parents 3381918 + 7e241f6 commit 7c98a42
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c98a42

Please sign in to comment.