diff options
author | Li Wang <liwang@ubuntukylin.com> | 2013-11-27 09:28:13 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-12-13 12:13:28 -0500 |
commit | f36132a75aafd0086aeb0eacf348654138d56b49 (patch) | |
tree | e385155978e3e4bfbaf326bb6e96f3924e87dd9e | |
parent | 8eb4efb091c8d8f70a0e6822288b043f8691ec51 (diff) |
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>
-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) | |||
256 | for (i = 0; i < num_pages; i++) { | 256 | for (i = 0; i < num_pages; i++) { |
257 | struct page *page = osd_data->pages[i]; | 257 | struct page *page = osd_data->pages[i]; |
258 | 258 | ||
259 | if (rc < 0) | ||
260 | goto unlock; | ||
259 | if (bytes < (int)PAGE_CACHE_SIZE) { | 261 | if (bytes < (int)PAGE_CACHE_SIZE) { |
260 | /* zero (remainder of) page */ | 262 | /* zero (remainder of) page */ |
261 | int s = bytes < 0 ? 0 : bytes; | 263 | int s = bytes < 0 ? 0 : bytes; |
@@ -266,6 +268,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) | |||
266 | flush_dcache_page(page); | 268 | flush_dcache_page(page); |
267 | SetPageUptodate(page); | 269 | SetPageUptodate(page); |
268 | ceph_readpage_to_fscache(inode, page); | 270 | ceph_readpage_to_fscache(inode, page); |
271 | unlock: | ||
269 | unlock_page(page); | 272 | unlock_page(page); |
270 | page_cache_release(page); | 273 | page_cache_release(page); |
271 | bytes -= PAGE_CACHE_SIZE; | 274 | bytes -= PAGE_CACHE_SIZE; |