aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorYan, Zheng2017-07-11 17:34:46 +0800
committerIlya Dryomov2017-09-06 19:56:41 +0200
commit95cca2b44e54b00a3ed6ed7dc869717cd6807e81 (patch)
tree944f555f63a1b9641f2598703a562777437b0456 /fs/ceph/file.c
parentaa187926b739fb391f153335c7552c7a10d60e82 (diff)
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" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c4
1 files changed, 3 insertions, 1 deletions
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;