linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs()
@ 2016-10-18  7:56 Wang Xiaoguang
  2016-10-18 10:32 ` Holger Hoffstätte
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Xiaoguang @ 2016-10-18  7:56 UTC (permalink / raw)
  To: linux-btrfs

In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we
swap the arg2 and arg3 wrongly, fix this.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
 fs/btrfs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2b790bd..2f1372b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4605,8 +4605,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
 			BUG_ON(ret);
 			if (btrfs_should_throttle_delayed_refs(trans, root))
 				btrfs_async_run_delayed_refs(root,
-							     trans->transid,
-					trans->delayed_ref_updates * 2, 0);
+					trans->delayed_ref_updates * 2,
+					trans->transid, 0);
 			if (be_nice) {
 				if (truncate_space_check(trans, root,
 							 extent_num_bytes)) {
-- 
2.9.0




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

* Re: [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs()
  2016-10-18  7:56 [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs() Wang Xiaoguang
@ 2016-10-18 10:32 ` Holger Hoffstätte
  2016-10-19  4:57   ` Wang Xiaoguang
  0 siblings, 1 reply; 4+ messages in thread
From: Holger Hoffstätte @ 2016-10-18 10:32 UTC (permalink / raw)
  To: linux-btrfs

On Tue, 18 Oct 2016 15:56:13 +0800, Wang Xiaoguang wrote:

> In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we
> swap the arg2 and arg3 wrongly, fix this.
> 
> Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
> ---
>  fs/btrfs/inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 2b790bd..2f1372b 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -4605,8 +4605,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
>  			BUG_ON(ret);
>  			if (btrfs_should_throttle_delayed_refs(trans, root))
>  				btrfs_async_run_delayed_refs(root,
> -							     trans->transid,
> -					trans->delayed_ref_updates * 2, 0);
> +					trans->delayed_ref_updates * 2,
> +					trans->transid, 0);
>  			if (be_nice) {
>  				if (truncate_space_check(trans, root,
>  							 extent_num_bytes)) {

Reviewed-by: Holger Hoffstätte <holger@applied-asynchrony.com>

Passing the wrong transid..why did this ever work?

-h


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

* Re: [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs()
  2016-10-18 10:32 ` Holger Hoffstätte
@ 2016-10-19  4:57   ` Wang Xiaoguang
  2016-10-19 14:02     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Xiaoguang @ 2016-10-19  4:57 UTC (permalink / raw)
  To: Holger Hoffstätte, linux-btrfs

hi,

On 10/18/2016 06:32 PM, Holger Hoffstätte wrote:
> On Tue, 18 Oct 2016 15:56:13 +0800, Wang Xiaoguang wrote:
>
>> In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we
>> swap the arg2 and arg3 wrongly, fix this.
>>
>> Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
>> ---
>>   fs/btrfs/inode.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>> index 2b790bd..2f1372b 100644
>> --- a/fs/btrfs/inode.c
>> +++ b/fs/btrfs/inode.c
>> @@ -4605,8 +4605,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
>>   			BUG_ON(ret);
>>   			if (btrfs_should_throttle_delayed_refs(trans, root))
>>   				btrfs_async_run_delayed_refs(root,
>> -							     trans->transid,
>> -					trans->delayed_ref_updates * 2, 0);
>> +					trans->delayed_ref_updates * 2,
>> +					trans->transid, 0);
>>   			if (be_nice) {
>>   				if (truncate_space_check(trans, root,
>>   							 extent_num_bytes)) {
> Reviewed-by: Holger Hoffstätte <holger@applied-asynchrony.com>
>
> Passing the wrong transid..why did this ever work?
Indeed this bug just impacts asynchronous delayed refs handle when we 
truncate
inodes.  In delayed_ref_async_start(), there is such codes:

     trans = btrfs_join_transaction(async->root);
     if (trans->transid > async->transid)
         goto end;
     ret = btrfs_run_delayed_refs(trans, async->root, async->count);

 From this codes, we can see that this just influence whether can we handle
delayed refs or the number of delayed refs to handle, this may impact
performance, but will not result in missing delayed refs, all delayed 
refs will
be handled in btrfs_commit_transaction().

Regards,
Xiaoguang Wang

>
> -h
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>




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

* Re: [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs()
  2016-10-19  4:57   ` Wang Xiaoguang
@ 2016-10-19 14:02     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2016-10-19 14:02 UTC (permalink / raw)
  To: Wang Xiaoguang; +Cc: Holger Hoffstätte, linux-btrfs

On Wed, Oct 19, 2016 at 12:57:19PM +0800, Wang Xiaoguang wrote:
> hi,
> 
> On 10/18/2016 06:32 PM, Holger Hoffstätte wrote:
> > On Tue, 18 Oct 2016 15:56:13 +0800, Wang Xiaoguang wrote:
> >
> >> In btrfs_truncate_inode_items()->btrfs_async_run_delayed_refs(), we
> >> swap the arg2 and arg3 wrongly, fix this.
> >>
> >> Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
> >> ---
> >>   fs/btrfs/inode.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> >> index 2b790bd..2f1372b 100644
> >> --- a/fs/btrfs/inode.c
> >> +++ b/fs/btrfs/inode.c
> >> @@ -4605,8 +4605,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
> >>   			BUG_ON(ret);
> >>   			if (btrfs_should_throttle_delayed_refs(trans, root))
> >>   				btrfs_async_run_delayed_refs(root,
> >> -							     trans->transid,
> >> -					trans->delayed_ref_updates * 2, 0);
> >> +					trans->delayed_ref_updates * 2,
> >> +					trans->transid, 0);
> >>   			if (be_nice) {
> >>   				if (truncate_space_check(trans, root,
> >>   							 extent_num_bytes)) {
> > Reviewed-by: Holger Hoffstätte <holger@applied-asynchrony.com>
> >
> > Passing the wrong transid..why did this ever work?
> Indeed this bug just impacts asynchronous delayed refs handle when we 
> truncate
> inodes.  In delayed_ref_async_start(), there is such codes:
> 
>      trans = btrfs_join_transaction(async->root);
>      if (trans->transid > async->transid)
>          goto end;
>      ret = btrfs_run_delayed_refs(trans, async->root, async->count);
> 
>  From this codes, we can see that this just influence whether can we handle
> delayed refs or the number of delayed refs to handle, this may impact
> performance, but will not result in missing delayed refs, all delayed 
> refs will
> be handled in btrfs_commit_transaction().

You should put this kind of information to the changelog itself, now
added.

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

end of thread, other threads:[~2016-10-19 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18  7:56 [PATCH] btrfs: pass correct args to btrfs_async_run_delayed_refs() Wang Xiaoguang
2016-10-18 10:32 ` Holger Hoffstätte
2016-10-19  4:57   ` Wang Xiaoguang
2016-10-19 14:02     ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).