Commit 8c71897b authored by Henry C Chang's avatar Henry C Chang Committed by Sage Weil

ceph: handle ceph_osdc_new_request failure in ceph_writepages_start

We should unlock the page and return -ENOMEM if ceph_osdc_new_request
failed.
Signed-off-by: default avatarHenry C Chang <henry_c_chang@tcloudcomputing.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ca20892d
...@@ -775,6 +775,13 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -775,6 +775,13 @@ static int ceph_writepages_start(struct address_space *mapping,
ci->i_truncate_seq, ci->i_truncate_seq,
ci->i_truncate_size, ci->i_truncate_size,
&inode->i_mtime, true, 1, 0); &inode->i_mtime, true, 1, 0);
if (!req) {
rc = -ENOMEM;
unlock_page(page);
break;
}
max_pages = req->r_num_pages; max_pages = req->r_num_pages;
alloc_page_vec(fsc, req); alloc_page_vec(fsc, req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment