From b0a30b9bfcae38dc60096e35484d8967bdafba78 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 2 Feb 2010 16:34:04 -0800 Subject: [PATCH] --- yaml --- r: 188689 b: refs/heads/master c: 79788c698b290426320e60374ed1324e4b5c69eb h: refs/heads/master i: 188687: 26bdcadf791cc82d13fccb200aef68fb8a98b389 v: v3 --- [refs] | 2 +- trunk/fs/ceph/addr.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 3df326afd76b..be3f304b0248 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0c948992a00d478c17042f4790b7d6b35299cf94 +refs/heads/master: 79788c698b290426320e60374ed1324e4b5c69eb diff --git a/trunk/fs/ceph/addr.c b/trunk/fs/ceph/addr.c index a3bd9deb555c..8065dc92c611 100644 --- a/trunk/fs/ceph/addr.c +++ b/trunk/fs/ceph/addr.c @@ -524,9 +524,13 @@ static void writepages_finish(struct ceph_osd_request *req, bytes = le64_to_cpu(op->extent.length); if (rc >= 0) { - wrote = (bytes + (offset & ~PAGE_CACHE_MASK) + ~PAGE_CACHE_MASK) - >> PAGE_CACHE_SHIFT; - WARN_ON(wrote != req->r_num_pages); + /* + * Assume we wrote the pages we originally sent. The + * 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 { wrote = 0; mapping_set_error(mapping, rc);