ceph: Add clean up if invalid osd reply received
Subsystems (3)
cover ceph: Add clean up if invalid osd reply received
Signed-off-by Li Wang <[email protected]>
Signed-off-by Yunchuan Wen <[email protected]>
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(+)
Signature · 1 line
1.7.9.5
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 <[email protected]>
Signed-off-by Yunchuan Wen <[email protected]>
--- fs/ceph/addr.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ceph/addr.c +3 -0
@@ -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 ;
Signature · 1 line
1.7.9.5
PATCH 2/2 ceph: Add necessary clean up if invalid reply received in handle_reply()
In reply to Li WangWake up possible waiters, invoke the call back if any, unregister the request
Signed-off-by Li Wang <[email protected]>
Signed-off-by Yunchuan Wen <[email protected]>
--- net/ceph/osd_client.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/ceph/osd_client.c +7 -0
@@ -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);
Signature · 1 line
1.7.9.5
APplied these both to teh testing branch. Thanks!
Quoted 21 lines · Li Wang
Signed-off-by Li Wang <[email protected]>Signed-off-by Yunchuan Wen <[email protected]>Li Wang (2):
ceph: Clean up if error occurred infinish_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(+)Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html