ceph: fix rsize/wsize capping in ceph_direct_read_write()
commit2c205ef7667cecc48dfa4e1fe3f4701666717846
authorIlya Dryomov <idryomov@gmail.com>
Thu, 3 May 2018 14:10:09 +0000 (3 16:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 May 2018 08:12:30 +0000 (16 10:12 +0200)
tree5d8f622a8f922db3706436a267895b3bc704de82
parent092d4bd6bdf55899d238737d6870adef6f225211
ceph: fix rsize/wsize capping in ceph_direct_read_write()

commit 3a15b38fd2efc1d648cb33186bf71e9138c93491 upstream.

rsize/wsize cap should be applied before ceph_osdc_new_request() is
called.  Otherwise, if the size is limited by the cap instead of the
stripe unit, ceph_osdc_new_request() would setup an extent op that is
bigger than what dio_get_pages_alloc() would pin and add to the page
vector, triggering asserts in the messenger.

Cc: stable@vger.kernel.org
Fixes: 95cca2b44e54 ("ceph: limit osd write size")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/file.c