lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPz4a6DiPaSAF3ZhmnTDnjwXHXv0at32QTMmRrgP8VyLOSG_Ug@mail.gmail.com>
Date:	Wed, 8 Feb 2012 21:56:54 -0800
From:	Dima Zavin <dima@...roid.com>
To:	Tim Bird <tim.bird@...sony.com>
Cc:	Greg KH <gregkh@...uxfoundation.org>,
	linux-embedded <linux-embedded@...r.kernel.org>,
	linux kernel <linux-kernel@...r.kernel.org>,
	Brian Swetland <swetland@...gle.com>,
	Andrew Morton <akpm@...l.org>
Subject: Re: [PATCH 3/5] logger: reorder prepare_to_wait and mutex_lock

On Tue, Feb 7, 2012 at 6:30 PM, Tim Bird <tim.bird@...sony.com> wrote:
> If mutex_lock waits, it will return in state TASK_RUNNING,
> rubbing out the effect of prepare_to_wait().
>
> Signed-off-by: Tim Bird <tim.bird@...sony.com>

Acked-by: Dima Zavin <dima@...roid.com>

> ---
>  drivers/staging/android/logger.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
> index 92cfd94..54b7cdf 100644
> --- a/drivers/staging/android/logger.c
> +++ b/drivers/staging/android/logger.c
> @@ -172,9 +172,10 @@ static ssize_t logger_read(struct file *file, char __user *buf,
>
>  start:
>        while (1) {
> +               mutex_lock(&log->mutex);
> +
>                prepare_to_wait(&log->wq, &wait, TASK_INTERRUPTIBLE);
>
> -               mutex_lock(&log->mutex);
>                ret = (log->w_off == reader->r_off);
>                mutex_unlock(&log->mutex);
>                if (!ret)
> --
> 1.7.2.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ