All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error.
@ 2013-07-16 11:36 majianpeng
  2013-07-17  0:44 ` Sage Weil
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-07-16 11:36 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 fs/ceph/ioctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index e0b4ef3..a5ce62e 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -196,8 +196,10 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
 	r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len,
 					  &dl.object_no, &dl.object_offset,
 					  &olen);
-	if (r < 0)
+	if (r < 0) {
+		up_read(&osdc->map_sem);
 		return -EIO;
+	}
 	dl.file_offset -= dl.object_offset;
 	dl.object_size = ceph_file_layout_object_size(ci->i_layout);
 	dl.block_size = ceph_file_layout_su(ci->i_layout);
-- 
1.8.1.2

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

* Re: [PATCH] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error.
  2013-07-16 11:36 [PATCH] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error majianpeng
@ 2013-07-17  0:44 ` Sage Weil
  0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2013-07-17  0:44 UTC (permalink / raw)
  To: majianpeng; +Cc: ceph-devel

Applied, thanks!

sage

On Tue, 16 Jul 2013, majianpeng wrote:

> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  fs/ceph/ioctl.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
> index e0b4ef3..a5ce62e 100644
> --- a/fs/ceph/ioctl.c
> +++ b/fs/ceph/ioctl.c
> @@ -196,8 +196,10 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
>  	r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len,
>  					  &dl.object_no, &dl.object_offset,
>  					  &olen);
> -	if (r < 0)
> +	if (r < 0) {
> +		up_read(&osdc->map_sem);
>  		return -EIO;
> +	}
>  	dl.file_offset -= dl.object_offset;
>  	dl.object_size = ceph_file_layout_object_size(ci->i_layout);
>  	dl.block_size = ceph_file_layout_su(ci->i_layout);
> -- 
> 1.8.1.2

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

end of thread, other threads:[~2013-07-17  0:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16 11:36 [PATCH] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error majianpeng
2013-07-17  0:44 ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.