From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:49554 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725968AbeKTSjO (ORCPT ); Tue, 20 Nov 2018 13:39:14 -0500 From: Nikolay Borisov To: stable@vger.kernel.org Cc: josef@toxicpanda.com, David Sterba Subject: [PATCH 1/3] btrfs: release metadata before running delayed refs Date: Tue, 20 Nov 2018 10:11:21 +0200 Message-Id: <20181120081121.4479-1-nborisov@suse.com> In-Reply-To: <1541967550185147@kroah.com> References: <1541967550185147@kroah.com> Sender: stable-owner@vger.kernel.org List-ID: From: Josef Bacik We want to release the unused reservation we have since it refills the delayed refs reserve, which will make everything go smoother when running the delayed refs if we're short on our reservation. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Omar Sandoval Reviewed-by: Liu Bo Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- Hello Greg, Here is a fixed up backport for upstream commit f45c752b65af46bf42963295c332865d95f97fff This one applies cleanly to 4.4.y and 4.9.y fs/btrfs/transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index be8eae80ff65..098016338f98 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1821,6 +1821,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, return ret; } + btrfs_trans_release_metadata(trans, root); + trans->block_rsv = NULL; + /* make a pass through all the delayed refs we have so far * any runnings procs may add more while we are here */ @@ -1830,9 +1833,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, return ret; } - btrfs_trans_release_metadata(trans, root); - trans->block_rsv = NULL; - cur_trans = trans->transaction; /* -- 2.17.1