All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range
@ 2013-06-10  6:27 Joseph Qi
  2013-06-10  7:14 ` Jeff Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Qi @ 2013-06-10  6:27 UTC (permalink / raw)
  To: ocfs2-devel

In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and
ocfs2_prepare_refcount_change_for_del failed, it goes to out and then
tries to call mutex_unlock without mutex_lock before.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
---
 fs/ocfs2/alloc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index b8a9d87..941e883 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -5655,7 +5655,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
 					       &ref_tree, NULL);
 		if (ret) {
 			mlog_errno(ret);
-			goto out;
+			goto bail;
 		}

 		ret = ocfs2_prepare_refcount_change_for_del(inode,
@@ -5666,7 +5666,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
 							    &extra_blocks);
 		if (ret < 0) {
 			mlog_errno(ret);
-			goto out;
+			goto bail;
 		}
 	}

@@ -5734,7 +5734,7 @@ out_commit:
 	ocfs2_commit_trans(osb, handle);
 out:
 	mutex_unlock(&tl_inode->i_mutex);
-
+bail:
 	if (meta_ac)
 		ocfs2_free_alloc_context(meta_ac);

-- 
1.7.9.7

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

* [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range
  2013-06-10  6:27 [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range Joseph Qi
@ 2013-06-10  7:14 ` Jeff Liu
  2013-06-10  7:51   ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Liu @ 2013-06-10  7:14 UTC (permalink / raw)
  To: ocfs2-devel

On 06/10/2013 02:27 PM, Joseph Qi wrote:

> In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and
> ocfs2_prepare_refcount_change_for_del failed, it goes to out and then
> tries to call mutex_unlock without mutex_lock before.

It's better to merge both into one patch because it's apparent that
ocfs2_reserve_blocks_for_rec_trunc() need to fix in the same way for
the same reason.

Thanks,
-Jeff

> 
> Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
> ---
>  fs/ocfs2/alloc.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index b8a9d87..941e883 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -5655,7 +5655,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
>  					       &ref_tree, NULL);
>  		if (ret) {
>  			mlog_errno(ret);
> -			goto out;
> +			goto bail;
>  		}
> 
>  		ret = ocfs2_prepare_refcount_change_for_del(inode,
> @@ -5666,7 +5666,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
>  							    &extra_blocks);
>  		if (ret < 0) {
>  			mlog_errno(ret);
> -			goto out;
> +			goto bail;
>  		}
>  	}
> 
> @@ -5734,7 +5734,7 @@ out_commit:
>  	ocfs2_commit_trans(osb, handle);
>  out:
>  	mutex_unlock(&tl_inode->i_mutex);
> -
> +bail:
>  	if (meta_ac)
>  		ocfs2_free_alloc_context(meta_ac);
> 

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

* [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range
  2013-06-10  7:14 ` Jeff Liu
@ 2013-06-10  7:51   ` Joseph Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2013-06-10  7:51 UTC (permalink / raw)
  To: ocfs2-devel

On 2013/6/10 15:14, Jeff Liu wrote:
> On 06/10/2013 02:27 PM, Joseph Qi wrote:
> 
>> In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and
>> ocfs2_prepare_refcount_change_for_del failed, it goes to out and then
>> tries to call mutex_unlock without mutex_lock before.
> 
> It's better to merge both into one patch because it's apparent that
> ocfs2_reserve_blocks_for_rec_trunc() need to fix in the same way for
> the same reason.
> 
> Thanks,
> -Jeff
> 
>>
>> Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
>> ---
>>  fs/ocfs2/alloc.c |    6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
>> index b8a9d87..941e883 100644
>> --- a/fs/ocfs2/alloc.c
>> +++ b/fs/ocfs2/alloc.c
>> @@ -5655,7 +5655,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
>>  					       &ref_tree, NULL);
>>  		if (ret) {
>>  			mlog_errno(ret);
>> -			goto out;
>> +			goto bail;
>>  		}
>>
>>  		ret = ocfs2_prepare_refcount_change_for_del(inode,
>> @@ -5666,7 +5666,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
>>  							    &extra_blocks);
>>  		if (ret < 0) {
>>  			mlog_errno(ret);
>> -			goto out;
>> +			goto bail;
>>  		}
>>  	}
>>
>> @@ -5734,7 +5734,7 @@ out_commit:
>>  	ocfs2_commit_trans(osb, handle);
>>  out:
>>  	mutex_unlock(&tl_inode->i_mutex);
>> -
>> +bail:
>>  	if (meta_ac)
>>  		ocfs2_free_alloc_context(meta_ac);
>>
> 
> 
> 
> 
Thanks for your review. I will merge them and then resend the patch.

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

end of thread, other threads:[~2013-06-10  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10  6:27 [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range Joseph Qi
2013-06-10  7:14 ` Jeff Liu
2013-06-10  7:51   ` Joseph Qi

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.