diff mbox

ceph: handle ceph_osdc_new_request failure in ceph_writepages_start

Message ID 1304415916-1894-1-git-send-email-henry_c_chang@tcloudcomputing.com (mailing list archive)
State New, archived
Headers show

Commit Message

Henry Chang May 3, 2011, 9:45 a.m. UTC
We should unlock the page and return -ENOMEM if ceph_osdc_new_request
failed.

Signed-off-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
---
 fs/ceph/addr.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 561438b..e14dd9f 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -775,6 +775,13 @@  get_more_pages:
 					    ci->i_truncate_seq,
 					    ci->i_truncate_size,
 					    &inode->i_mtime, true, 1, 0);
+
+				if (!req) {
+					rc = -ENOMEM;
+					unlock_page(page);
+					break;
+				}
+
 				max_pages = req->r_num_pages;
 
 				alloc_page_vec(fsc, req);