diff mbox series

[42/42] btrfs: don't run delayed_iputs in commit

Message ID 20181011195431.3441-43-josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series My current patch queue | expand

Commit Message

Josef Bacik Oct. 11, 2018, 7:54 p.m. UTC
This could result in a really bad case where we do something like

evict
  evict_refill_and_join
    btrfs_commit_transaction
      btrfs_run_delayed_iputs
        evict
          evict_refill_and_join
            btrfs_commit_transaction
... forever

We have plenty of other places where we run delayed iputs that are much
safer, let those do the work.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/transaction.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Filipe Manana Oct. 11, 2018, 8:36 p.m. UTC | #1
On Thu, Oct 11, 2018 at 8:58 PM Josef Bacik <josef@toxicpanda.com> wrote:
>
> This could result in a really bad case where we do something like
>
> evict
>   evict_refill_and_join
>     btrfs_commit_transaction
>       btrfs_run_delayed_iputs
>         evict
>           evict_refill_and_join
>             btrfs_commit_transaction
> ... forever
>
> We have plenty of other places where we run delayed iputs that are much
> safer, let those do the work.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>

Great catch!

> ---
>  fs/btrfs/transaction.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 9168efaca37e..c91dc36fccae 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2265,15 +2265,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
>
>         kmem_cache_free(btrfs_trans_handle_cachep, trans);
>
> -       /*
> -        * If fs has been frozen, we can not handle delayed iputs, otherwise
> -        * it'll result in deadlock about SB_FREEZE_FS.
> -        */
> -       if (current != fs_info->transaction_kthread &&
> -           current != fs_info->cleaner_kthread &&
> -           !test_bit(BTRFS_FS_FROZEN, &fs_info->flags))
> -               btrfs_run_delayed_iputs(fs_info);
> -
>         return ret;
>
>  scrub_continue:
> --
> 2.14.3
>
diff mbox series

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 9168efaca37e..c91dc36fccae 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2265,15 +2265,6 @@  int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 
 	kmem_cache_free(btrfs_trans_handle_cachep, trans);
 
-	/*
-	 * If fs has been frozen, we can not handle delayed iputs, otherwise
-	 * it'll result in deadlock about SB_FREEZE_FS.
-	 */
-	if (current != fs_info->transaction_kthread &&
-	    current != fs_info->cleaner_kthread &&
-	    !test_bit(BTRFS_FS_FROZEN, &fs_info->flags))
-		btrfs_run_delayed_iputs(fs_info);
-
 	return ret;
 
 scrub_continue: