On Tue, 3 May 2011, Henry C Chang wrote: > We should unlock the page and return -ENOMEM if ceph_osdc_new_request > failed. > > Signed-off-by: Henry C Chang <henry_c_chang@xxxxxxxxxxxxxxxxxxx> > --- > 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 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); > -- > 1.7.2.3 Applied, along with >From dbd49b7b369232fe2db568366f594689e8a57fff Mon Sep 17 00:00:00 2001 From: Sage Weil <sage@xxxxxxxxxxxx> Date: Tue, 3 May 2011 09:23:36 -0700 Subject: [PATCH] libceph: fix ceph_osdc_alloc_request error checks ceph_osdc_alloc_request returns NULL on failure. Signed-off-by: Sage Weil <sage@xxxxxxxxxxxx> --- drivers/block/rbd.c | 4 ++-- net/ceph/osd_client.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 16dc364..3e90471 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq, ops, false, GFP_NOIO, pages, bio); - if (IS_ERR(req)) { + if (!req) { up_read(&header->snap_rwsem); - ret = PTR_ERR(req); + ret = -ENOMEM; goto done_pages; } diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 9204de4..33fe81a 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, snapc, ops, use_mempool, GFP_NOFS, NULL, NULL); - if (IS_ERR(req)) - return req; + if (!req) + return NULL; /* calculate max write size */ calc_layout(osdc, vino, layout, off, plen, req, ops); -- 1.7.0 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html