]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix iov_iter issues in ceph_direct_read_write()
authorIlya Dryomov <idryomov@gmail.com>
Fri, 4 May 2018 14:57:31 +0000 (16:57 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 10 May 2018 08:15:12 +0000 (10:15 +0200)
commitbbf9280e57d1257d1f5f35a3358a161c15e6258d
tree7a9216495d534db12d61093fc8f762798f1982f7
parent14ae5f4ff5e0e22f0838612593ae6b9d9524d932
ceph: fix iov_iter issues in ceph_direct_read_write()

dio_get_pagev_size() and dio_get_pages_alloc() introduced in commit
a5bf9ffd32d1 ("ceph: combine as many iovec as possile into one OSD
request") assume that the passed iov_iter is ITER_IOVEC.  This isn't
the case with splice where it ends up poking into the guts of ITER_BVEC
or ITER_PIPE iterators, causing lockups and crashes easily reproduced
with generic/095.

Rather than trying to figure out gap alignment and stuff pages into
a page vector, add a helper for going from iov_iter to a bio_vec array
and make use of the new CEPH_OSD_DATA_TYPE_BVECS code.

Fixes: a5bf9ffd32d1 ("ceph: combine as many iovec as possile into one OSD request")
Link: http://tracker.ceph.com/issues/18130
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Tested-by: Luis Henriques <lhenriques@suse.com>
fs/ceph/file.c