summaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osd_client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index d730dd4d8eb..cf4e15bfe0d 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -109,7 +109,7 @@ static int calc_layout(struct ceph_vino vino,
snprintf(req->r_oid, sizeof(req->r_oid), "%llx.%08llx", vino.ino, bno);
req->r_oid_len = strlen(req->r_oid);
- return r;
+ return 0;
}
/*
@@ -470,8 +470,10 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
/* calculate max write size */
r = calc_layout(vino, layout, off, plen, req, ops);
- if (r < 0)
+ if (r < 0) {
+ ceph_osdc_put_request(req);
return ERR_PTR(r);
+ }
req->r_file_layout = *layout; /* keep a copy */
/* in case it differs from natural (file) alignment that