diff options
author | Li Wang <liwang@ubuntukylin.com> | 2013-11-27 15:28:13 +0100 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-12-13 18:13:28 +0100 |
commit | f36132a75aafd0086aeb0eacf348654138d56b49 (patch) | |
tree | e385155978e3e4bfbaf326bb6e96f3924e87dd9e /fs/ceph/addr.c | |
parent | ceph: implement readv/preadv for sync operation (diff) | |
download | linux-f36132a75aafd0086aeb0eacf348654138d56b49.tar.xz linux-f36132a75aafd0086aeb0eacf348654138d56b49.zip |
ceph: Clean up if error occurred in finish_read()
Clean up if error occurred rather than going through normal process
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r-- | fs/ceph/addr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index ec3ba43b9faa..c346b8479f99 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -256,6 +256,8 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) for (i = 0; i < num_pages; i++) { struct page *page = osd_data->pages[i]; + if (rc < 0) + goto unlock; if (bytes < (int)PAGE_CACHE_SIZE) { /* zero (remainder of) page */ int s = bytes < 0 ? 0 : bytes; @@ -266,6 +268,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) flush_dcache_page(page); SetPageUptodate(page); ceph_readpage_to_fscache(inode, page); +unlock: unlock_page(page); page_cache_release(page); bytes -= PAGE_CACHE_SIZE; |