diff mbox

Btrfs: remove BUG_ON in start_transaction

Message ID 1473819348-8681-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Liu Bo Sept. 14, 2016, 2:15 a.m. UTC
Since we could get errors from the concurrent aborted transaction,
the check of this BUG_ON in start_transaction is not true any more.

Say, while flushing free space cache inode's dirty pages,
btrfs_finish_ordered_io
 -> btrfs_join_transaction_nolock
      (the transaction has been aborted.)
      -> BUG_ON(type == TRANS_JOIN_NOLOCK);

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/transaction.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Josef Bacik Sept. 14, 2016, 1:30 p.m. UTC | #1
On 09/13/2016 10:15 PM, Liu Bo wrote:
> Since we could get errors from the concurrent aborted transaction,
> the check of this BUG_ON in start_transaction is not true any more.
>
> Say, while flushing free space cache inode's dirty pages,
> btrfs_finish_ordered_io
>  -> btrfs_join_transaction_nolock
>       (the transaction has been aborted.)
>       -> BUG_ON(type == TRANS_JOIN_NOLOCK);
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  fs/btrfs/transaction.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 95d4191..6d06365 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -549,11 +549,8 @@ again:
>  		}
>  	} while (ret == -EBUSY);
>
> -	if (ret < 0) {
> -		/* We must get the transaction if we are JOIN_NOLOCK. */
> -		BUG_ON(type == TRANS_JOIN_NOLOCK);
> +	if (ret < 0)
>  		goto join_fail;
> -	}
>
>  	cur_trans = root->fs_info->running_transaction;
>
>

Reviewed-by: Josef Bacik <jbacik@fb.com>

Thanks,

Josef
--
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
diff mbox

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 95d4191..6d06365 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -549,11 +549,8 @@  again:
 		}
 	} while (ret == -EBUSY);
 
-	if (ret < 0) {
-		/* We must get the transaction if we are JOIN_NOLOCK. */
-		BUG_ON(type == TRANS_JOIN_NOLOCK);
+	if (ret < 0)
 		goto join_fail;
-	}
 
 	cur_trans = root->fs_info->running_transaction;