[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1947b705cc4c308f96591b19bbe0065d13a1058e.1385561919.git.liwang@ubuntukylin.com>
Date: Wed, 27 Nov 2013 22:28:13 +0800
From: Li Wang <liwang@...ntukylin.com>
To: ceph-devel@...r.kernel.org
Cc: Sage Weil <sage@...tank.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, Li Wang <liwang@...ntukylin.com>,
Yunchuan Wen <yunchuanwen@...ntukylin.com>
Subject: [PATCH 1/2] 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@...ntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@...ntukylin.com>
---
fs/ceph/addr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 1e561c0..97845b4 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -252,6 +252,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;
@@ -262,6 +264,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;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists