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: <482AFA28.8020403@suse.com>
Date:	Wed, 14 May 2008 10:41:44 -0400
From:	Jeff Mahoney <jeffm@...e.com>
To:	linux-kernel@...r.kernel.org
Cc:	reiserfs-devel@...r.kernel.org, Andrew Morton <akpm@...l.org>,
	kamalesh@...ux.vnet.ibm.com
Subject: Re: [patch 2/3] [PATCH] reiserfs: convert j_flush_sem to mutex

Jeff Mahoney wrote:
>  j_flush_sem is a semaphore but uses it as if it were a mutex. This
>  patch converts it to a mutex.
> --- a/fs/reiserfs/journal.c
> +++ b/fs/reiserfs/journal.c
> @@ -1411,8 +1411,8 @@ static int flush_journal_list(struct sup
>  
>  	/* if flushall == 0, the lock is already held */
>  	if (flushall) {
> -		down(&journal->j_flush_sem);
> -	} else if (!down_trylock(&journal->j_flush_sem)) {
> +		mutex_lock(&journal->j_flush_mutex);
> +	} else if (!mutex_trylock(&journal->j_flush_mutex)) {
>  		BUG();
>  	}

Oops. This chunk didn't get refreshed, here's the right one.

-Jeff

Signed-off-by: Jeff Mahoney <jeffm@...e.com>
---
 fs/reiserfs/journal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1410,7 +1410,7 @@ static int flush_journal_list(struct sup
 	/* if flushall == 0, the lock is already held */
 	if (flushall) {
 		mutex_lock(&journal->j_flush_mutex);
-	} else if (!mutex_trylock(&journal->j_flush_mutex)) {
+	} else if (mutex_trylock(&journal->j_flush_mutex)) {
 		BUG();
 	}
 


-- 
Jeff Mahoney
SUSE Labs
--
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