diff options
author | Henry C Chang | 2011-05-03 09:45:16 +0000 |
---|---|---|
committer | Sage Weil | 2011-05-03 09:28:12 -0700 |
commit | 8c71897be2ddfd84969412635ca42fa9e137f7b6 (patch) | |
tree | 7403c84c264f1fd0110869bad68405fcaf6c80ba /fs/ceph | |
parent | ca20892db7567c40e8ed0668f46cf0d085d7db6d (diff) |
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: Henry C Chang <henry_c_chang@tcloudcomputing.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/addr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index e159c529fd2b..38b8ab554924 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); |