* [PATCH 0/2] ceph: Add clean up if invalid osd reply received
@ 2013-11-27 14:28 Li Wang
2013-11-27 14:28 ` [PATCH 1/2] ceph: Clean up if error occurred in finish_read() Li Wang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Li Wang @ 2013-11-27 14:28 UTC (permalink / raw)
To: ceph-devel; +Cc: Sage Weil, linux-fsdevel, linux-kernel, Li Wang, Yunchuan Wen
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Li Wang (2):
ceph: Clean up if error occurred in finish_read()
ceph: Add necessary clean up if invalid reply received in
handle_reply()
fs/ceph/addr.c | 3 +++
net/ceph/osd_client.c | 7 +++++++
2 files changed, 10 insertions(+)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ceph: Clean up if error occurred in finish_read()
2013-11-27 14:28 [PATCH 0/2] ceph: Add clean up if invalid osd reply received Li Wang
@ 2013-11-27 14:28 ` Li Wang
2013-11-27 14:28 ` [PATCH 2/2] ceph: Add necessary clean up if invalid reply received in handle_reply() Li Wang
2013-12-05 6:04 ` [PATCH 0/2] ceph: Add clean up if invalid osd reply received Sage Weil
2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2013-11-27 14:28 UTC (permalink / raw)
To: ceph-devel; +Cc: Sage Weil, linux-fsdevel, linux-kernel, Li Wang, Yunchuan Wen
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ceph: Add necessary clean up if invalid reply received in handle_reply()
2013-11-27 14:28 [PATCH 0/2] ceph: Add clean up if invalid osd reply received Li Wang
2013-11-27 14:28 ` [PATCH 1/2] ceph: Clean up if error occurred in finish_read() Li Wang
@ 2013-11-27 14:28 ` Li Wang
2013-12-05 6:04 ` [PATCH 0/2] ceph: Add clean up if invalid osd reply received Sage Weil
2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2013-11-27 14:28 UTC (permalink / raw)
To: ceph-devel; +Cc: Sage Weil, linux-fsdevel, linux-kernel, Li Wang, Yunchuan Wen
Wake up possible waiters, invoke the call back if any, unregister the request
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
---
net/ceph/osd_client.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 2b4b32a..a17eaae 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1581,6 +1581,13 @@ done:
return;
bad_put:
+ req->r_result = -EIO;
+ __unregister_request(osdc, req);
+ if (req->r_callback)
+ req->r_callback(req, msg);
+ else
+ complete_all(&req->r_completion);
+ complete_request(req);
ceph_osdc_put_request(req);
bad_mutex:
mutex_unlock(&osdc->request_mutex);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ceph: Add clean up if invalid osd reply received
2013-11-27 14:28 [PATCH 0/2] ceph: Add clean up if invalid osd reply received Li Wang
2013-11-27 14:28 ` [PATCH 1/2] ceph: Clean up if error occurred in finish_read() Li Wang
2013-11-27 14:28 ` [PATCH 2/2] ceph: Add necessary clean up if invalid reply received in handle_reply() Li Wang
@ 2013-12-05 6:04 ` Sage Weil
2 siblings, 0 replies; 4+ messages in thread
From: Sage Weil @ 2013-12-05 6:04 UTC (permalink / raw)
To: Li Wang; +Cc: ceph-devel, linux-fsdevel, linux-kernel, Yunchuan Wen
APplied these both to teh testing branch. Thanks!
On Wed, 27 Nov 2013, Li Wang wrote:
> Signed-off-by: Li Wang <liwang@ubuntukylin.com>
> Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
>
> Li Wang (2):
> ceph: Clean up if error occurred in finish_read()
> ceph: Add necessary clean up if invalid reply received in
> handle_reply()
>
> fs/ceph/addr.c | 3 +++
> net/ceph/osd_client.c | 7 +++++++
> 2 files changed, 10 insertions(+)
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-05 6:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 14:28 [PATCH 0/2] ceph: Add clean up if invalid osd reply received Li Wang
2013-11-27 14:28 ` [PATCH 1/2] ceph: Clean up if error occurred in finish_read() Li Wang
2013-11-27 14:28 ` [PATCH 2/2] ceph: Add necessary clean up if invalid reply received in handle_reply() Li Wang
2013-12-05 6:04 ` [PATCH 0/2] ceph: Add clean up if invalid osd reply received Sage Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox