From 95cca2b44e54b00a3ed6ed7dc869717cd6807e81 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 11 Jul 2017 17:34:46 +0800 Subject: ceph: limit osd write size OSD has a configurable limitation of max write size. OSD return error if write request size is larger than the limitation. For now, set max write size to CEPH_MSG_MAX_DATA_LEN. It should be small enough. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov --- fs/ceph/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/ceph/file.c') diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 85f0dba394a2..a39ff54cb372 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -887,7 +887,9 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, break; } - if (!write) + if (write) + size = min_t(u64, size, fsc->mount_options->wsize); + else size = min_t(u64, size, fsc->mount_options->rsize); len = size; -- cgit v1.2.3