Commit 79788c69 authored by Sage Weil's avatar Sage Weil

ceph: release all pages after successful osd write response

We release all the pages, even if the osd response was
different than the number of pages written. This could only
happen due to truncation that arrives the osd in
different order, for which we want the pages released anyway.
Signed-off-by: default avatarYehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 0c948992
...@@ -524,9 +524,13 @@ static void writepages_finish(struct ceph_osd_request *req, ...@@ -524,9 +524,13 @@ static void writepages_finish(struct ceph_osd_request *req,
bytes = le64_to_cpu(op->extent.length); bytes = le64_to_cpu(op->extent.length);
if (rc >= 0) { if (rc >= 0) {
wrote = (bytes + (offset & ~PAGE_CACHE_MASK) + ~PAGE_CACHE_MASK) /*
>> PAGE_CACHE_SHIFT; * Assume we wrote the pages we originally sent. The
WARN_ON(wrote != req->r_num_pages); * osd might reply with fewer pages if our writeback
* raced with a truncation and was adjusted at the osd,
* so don't believe the reply.
*/
wrote = req->r_num_pages;
} else { } else {
wrote = 0; wrote = 0;
mapping_set_error(mapping, rc); mapping_set_error(mapping, rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment