summaryrefslogtreecommitdiff
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c4
-rw-r--r--net/ceph/osd_client.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d1183536d5a8..1965d785cf83 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2692,6 +2692,8 @@ EXPORT_SYMBOL(ceph_con_keepalive);
void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages,
size_t length, size_t alignment)
{
+ /* BUG_ON(!pages); */
+ /* BUG_ON(!length); */
/* BUG_ON(msg->pages); */
/* BUG_ON(msg->page_count); */
@@ -2705,6 +2707,7 @@ void ceph_msg_data_set_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist)
{
/* BUG_ON(!pagelist); */
+ /* BUG_ON(!pagelist->length); */
/* BUG_ON(msg->pagelist); */
msg->pagelist = pagelist;
@@ -2723,6 +2726,7 @@ EXPORT_SYMBOL(ceph_msg_data_set_bio);
void ceph_msg_data_set_trail(struct ceph_msg *msg, struct ceph_pagelist *trail)
{
/* BUG_ON(!trail); */
+ /* BUG_ON(!trail->length); */
/* BUG_ON(msg->trail); */
msg->trail = trail;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 387e3123d1ed..4402e917b9b1 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1759,8 +1759,10 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
osd_data = &req->r_data_out;
if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) {
BUG_ON(osd_data->length > (u64) SIZE_MAX);
- ceph_msg_data_set_pages(req->r_request, osd_data->pages,
- osd_data->length, osd_data->alignment);
+ if (osd_data->length)
+ ceph_msg_data_set_pages(req->r_request,
+ osd_data->pages, osd_data->length,
+ osd_data->alignment);
#ifdef CONFIG_BLOCK
} else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) {
ceph_msg_data_set_bio(req->r_request, osd_data->bio);
@@ -1768,7 +1770,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
} else {
BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE);
}
- ceph_msg_data_set_trail(req->r_request, &req->r_trail);
+ if (req->r_trail.length)
+ ceph_msg_data_set_trail(req->r_request, &req->r_trail);
register_request(osdc, req);