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>
This commit is contained in:
Yan, Zheng
2017-07-11 17:34:46 +08:00
committed by Ilya Dryomov
parent aa187926b7
commit 95cca2b44e
4 changed files with 11 additions and 5 deletions

View File

@@ -779,10 +779,8 @@ static int ceph_writepages_start(struct address_space *mapping,
mapping_set_error(mapping, -EIO);
return -EIO; /* we're in a forced umount, don't write! */
}
if (fsc->mount_options->wsize && fsc->mount_options->wsize < wsize)
if (fsc->mount_options->wsize < wsize)
wsize = fsc->mount_options->wsize;
if (wsize < PAGE_SIZE)
wsize = PAGE_SIZE;
max_pages_ever = wsize >> PAGE_SHIFT;
pagevec_init(&pvec, 0);