public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Jeff Mahoney <jeffm@suse.com>
Cc: linux-kernel@vger.kernel.org, reiserfs-devel@vger.kernel.org,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [patch 2/3] [PATCH] reiserfs: convert j_flush_sem to mutex
Date: Wed, 14 May 2008 23:52:01 +0530	[thread overview]
Message-ID: <482B2DC9.3050503@linux.vnet.ibm.com> (raw)
In-Reply-To: <482AFA28.8020403@suse.com>

Jeff Mahoney wrote:
> 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

Thanks, the patch resolves the kernel bug.

Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> 
> Signed-off-by: Jeff Mahoney <jeffm@suse.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();
>  	}
> 


-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

  reply	other threads:[~2008-05-14 18:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  6:35 [patch 0/3] eliminate struct semaphore from reiserfs Jeff Mahoney
2008-05-08  6:35 ` [patch 1/3] [PATCH] reiserfs: convert j_lock to mutex Jeff Mahoney
2008-05-08  6:35 ` [patch 2/3] [PATCH] reiserfs: convert j_flush_sem " Jeff Mahoney
2008-05-14 14:41   ` Jeff Mahoney
2008-05-14 18:22     ` Kamalesh Babulal [this message]
2008-05-08  6:36 ` [patch 3/3] [PATCH] reiserfs: convert j_commit_lock " Jeff Mahoney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=482B2DC9.3050503@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=akpm@osdl.org \
    --cc=jeffm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox