ceph: handle ceph_osdc_new_request failure in ceph_writepages_start
authorHenry C Chang <henry.cy.chang@gmail.com>
Tue, 3 May 2011 09:45:16 +0000 (09:45 +0000)
committerSage Weil <sage@newdream.net>
Tue, 3 May 2011 16:28:12 +0000 (09:28 -0700)
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>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/addr.c

index e159c529fd2bbc845bbd893f645ac7633d91b9eb..38b8ab554924cd2d4a9ddf11ce3a79efe3d411cd 100644 (file)
@@ -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);