summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-07-11 15:56:09 +0800
committerIlya Dryomov <idryomov@gmail.com>2017-09-06 19:56:03 +0200
commitaa187926b739fb391f153335c7552c7a10d60e82 (patch)
tree0954de9620a7afe747bdbf3fcca503f11afd630c /fs/ceph/file.c
parent2ae409dc6a907e80f4cd32ad4482ef52441e3147 (diff)
downloadlinux-aa187926b739fb391f153335c7552c7a10d60e82.tar.bz2
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.c3
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)) {