]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix rsize/wsize capping in ceph_direct_read_write()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 3 May 2018 14:10:09 +0000 (16:10 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 10 May 2018 08:15:00 +0000 (10:15 +0200)
commit1f81c9d4028a8d4e2081793dc9725f14075a8759
tree0b73b8c86665270a3c56d6de453d6cab0b5ab1e1
parentafa228a6773efce28def42a14cc737f0fbf48cd7
ceph: fix rsize/wsize capping in ceph_direct_read_write()

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: dc8964b6ffa6 ("ceph: limit osd write size")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
fs/ceph/file.c