diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-07-11 10:56:09 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-09-06 20:56:03 +0300 |
commit | aa187926b739fb391f153335c7552c7a10d60e82 (patch) | |
tree | 0954de9620a7afe747bdbf3fcca503f11afd630c /fs/ceph/file.c | |
parent | 2ae409dc6a907e80f4cd32ad4482ef52441e3147 (diff) | |
download | linux-aa187926b739fb391f153335c7552c7a10d60e82.tar.xz |
ceph: limit osd read size to CEPH_MSG_MAX_DATA_LEN
libceph returns -EIO when read size > CEPH_MSG_MAX_DATA_LEN.
Link: http://tracker.ceph.com/issues/20528
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 3d48c415f3cb..85f0dba394a2 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -887,6 +887,9 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, break; } + if (!write) + size = min_t(u64, size, fsc->mount_options->rsize); + len = size; pages = dio_get_pages_alloc(iter, len, &start, &num_pages); if (IS_ERR(pages)) { |