Skip to content

Commit

Permalink
ceph: handle ceph_osdc_new_request failure in ceph_writepages_start
Browse files Browse the repository at this point in the history
We should unlock the page and return -ENOMEM if ceph_osdc_new_request
failed.

Signed-off-by: Henry C Chang <[email protected]>
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
henrycc authored and liewegas committed May 3, 2011
1 parent ca20892 commit 8c71897
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,13 @@ static int ceph_writepages_start(struct address_space *mapping,
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);
Expand Down

0 comments on commit 8c71897

Please sign in to comment.