All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files
@ 2009-01-17 11:04 Jiri Slaby
  2009-01-17 19:41 ` Eduard - Gabriel Munteanu
  2009-01-19 10:15 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-01-17 11:04 UTC (permalink / raw
  To: axboe; +Cc: linux-kernel, Jiri Slaby, Eduard - Gabriel Munteanu, Jens Axboe

One fail path in relay_late_setup_files() omits
mutex_unlock(&relay_channels_mutex);
Add it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Jens Axboe <axboe@suse.de>
---
 kernel/relay.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 8ca1587..738bc85 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -714,8 +714,10 @@ int relay_late_setup_files(struct rchan *chan,
 
 	mutex_lock(&relay_channels_mutex);
 	/* Is chan already set up? */
-	if (unlikely(chan->has_base_filename))
+	if (unlikely(chan->has_base_filename)) {
+		mutex_unlock(&relay_channels_mutex);
 		return -EEXIST;
+	}
 	chan->has_base_filename = 1;
 	chan->parent = parent;
 	curr_cpu = get_cpu();
-- 
1.6.1
caught by stanse

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

* Re: [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files
  2009-01-17 11:04 [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files Jiri Slaby
@ 2009-01-17 19:41 ` Eduard - Gabriel Munteanu
  2009-01-19 10:15 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Eduard - Gabriel Munteanu @ 2009-01-17 19:41 UTC (permalink / raw
  To: Jiri Slaby; +Cc: axboe, linux-kernel, Jens Axboe

On Sat, Jan 17, 2009 at 12:04:36PM +0100, Jiri Slaby wrote:
> One fail path in relay_late_setup_files() omits
> mutex_unlock(&relay_channels_mutex);
> Add it.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
> Cc: Jens Axboe <axboe@suse.de>

Oh, I missed that. Looks good to me.


	Thanks,
	Eduard


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

* Re: [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files
  2009-01-17 11:04 [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files Jiri Slaby
  2009-01-17 19:41 ` Eduard - Gabriel Munteanu
@ 2009-01-19 10:15 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-01-19 10:15 UTC (permalink / raw
  To: Jiri Slaby; +Cc: linux-kernel, Eduard - Gabriel Munteanu, Jens Axboe

On Sat, Jan 17 2009, Jiri Slaby wrote:
> One fail path in relay_late_setup_files() omits
> mutex_unlock(&relay_channels_mutex);
> Add it.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
> Cc: Jens Axboe <axboe@suse.de>
> ---
>  kernel/relay.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

Looks good, applied!

> 
> diff --git a/kernel/relay.c b/kernel/relay.c
> index 8ca1587..738bc85 100644
> --- a/kernel/relay.c
> +++ b/kernel/relay.c
> @@ -714,8 +714,10 @@ int relay_late_setup_files(struct rchan *chan,
>  
>  	mutex_lock(&relay_channels_mutex);
>  	/* Is chan already set up? */
> -	if (unlikely(chan->has_base_filename))
> +	if (unlikely(chan->has_base_filename)) {
> +		mutex_unlock(&relay_channels_mutex);
>  		return -EEXIST;
> +	}
>  	chan->has_base_filename = 1;
>  	chan->parent = parent;
>  	curr_cpu = get_cpu();
> -- 
> 1.6.1
> caught by stanse
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Jens Axboe


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

end of thread, other threads:[~2009-01-19 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17 11:04 [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files Jiri Slaby
2009-01-17 19:41 ` Eduard - Gabriel Munteanu
2009-01-19 10:15 ` Jens Axboe

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.