summaryrefslogtreecommitdiff
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-07-11 17:34:46 +0800
committerIlya Dryomov <idryomov@gmail.com>2017-09-06 19:56:41 +0200
commit95cca2b44e54b00a3ed6ed7dc869717cd6807e81 (patch)
tree944f555f63a1b9641f2598703a562777437b0456 /fs/ceph/super.c
parentaa187926b739fb391f153335c7552c7a10d60e82 (diff)
downloadlwn-95cca2b44e54b00a3ed6ed7dc869717cd6807e81.tar.gz
lwn-95cca2b44e54b00a3ed6ed7dc869717cd6807e81.zip
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/super.c')
-rw-r--r--fs/ceph/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 2b2a260acb24..caf9801712ca 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -233,7 +233,9 @@ static int parse_fsopt_token(char *c, void *private)
break;
/* misc */
case Opt_wsize:
- fsopt->wsize = intval;
+ if (intval < PAGE_SIZE || intval > CEPH_MAX_WRITE_SIZE)
+ return -EINVAL;
+ fsopt->wsize = ALIGN(intval, PAGE_SIZE);
break;
case Opt_rsize:
if (intval < PAGE_SIZE || intval > CEPH_MAX_READ_SIZE)
@@ -392,6 +394,7 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt,
fsopt->sb_flags = flags;
fsopt->flags = CEPH_MOUNT_OPT_DEFAULT;
+ fsopt->wsize = CEPH_MAX_WRITE_SIZE;
fsopt->rsize = CEPH_MAX_READ_SIZE;
fsopt->rasize = CEPH_RASIZE_DEFAULT;
fsopt->snapdir_name = kstrdup(CEPH_SNAPDIRNAME_DEFAULT, GFP_KERNEL);