public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] ceph: unlock on error in ceph_osdc_start_request()
@ 2011-03-29  3:25 Dan Carpenter
  2011-03-29 15:56 ` Sage Weil
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-29  3:25 UTC (permalink / raw)
  To: Sage Weil; +Cc: ceph-devel, kernel-janitors

There was a missing unlock on the error path if __map_request() failed.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b6776cb..03740e8 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1672,7 +1672,7 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
 	if (req->r_sent = 0) {
 		rc = __map_request(osdc, req);
 		if (rc < 0)
-			return rc;
+			goto out_unlock;
 		if (req->r_osd = NULL) {
 			dout("send_request %p no up osds in pg\n", req);
 			ceph_monc_request_next_osdmap(&osdc->client->monc);
@@ -1689,6 +1689,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
 			}
 		}
 	}
+
+out_unlock:
 	mutex_unlock(&osdc->request_mutex);
 	up_read(&osdc->map_sem);
 	return rc;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 2/2] ceph: unlock on error in ceph_osdc_start_request()
  2011-03-29  3:25 [patch 2/2] ceph: unlock on error in ceph_osdc_start_request() Dan Carpenter
@ 2011-03-29 15:56 ` Sage Weil
  0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2011-03-29 15:56 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: ceph-devel, kernel-janitors

Thanks, applied this one!

sage


On Tue, 29 Mar 2011, Dan Carpenter wrote:

> There was a missing unlock on the error path if __map_request() failed.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index b6776cb..03740e8 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -1672,7 +1672,7 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
>  	if (req->r_sent = 0) {
>  		rc = __map_request(osdc, req);
>  		if (rc < 0)
> -			return rc;
> +			goto out_unlock;
>  		if (req->r_osd = NULL) {
>  			dout("send_request %p no up osds in pg\n", req);
>  			ceph_monc_request_next_osdmap(&osdc->client->monc);
> @@ -1689,6 +1689,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
>  			}
>  		}
>  	}
> +
> +out_unlock:
>  	mutex_unlock(&osdc->request_mutex);
>  	up_read(&osdc->map_sem);
>  	return rc;
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-29 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29  3:25 [patch 2/2] ceph: unlock on error in ceph_osdc_start_request() Dan Carpenter
2011-03-29 15:56 ` Sage Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox