Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3469689imu; Sun, 11 Nov 2018 15:50:05 -0800 (PST) X-Google-Smtp-Source: AJdET5exxn8227SBBG28WmLIzukxiaChQ7ZVqPJTqn0v9qZZwfJ5NYtTqaCtJxj4NqQouvpbygKh X-Received: by 2002:a62:8915:: with SMTP id v21-v6mr18269262pfd.137.1541980205757; Sun, 11 Nov 2018 15:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980205; cv=none; d=google.com; s=arc-20160816; b=UXeSC8tf0WEU2UceLyUb65fT0N1fJ6PDMlJ/+cb7R4FhpN8/MWo5AJ3jyiqT1c9h/y +mTB4vbmiElWr/KTLKuq56oj4VTuFgAeujQBOVQziM0UKxiy+e9vovN19eoCg9seabrS Esf/Uw3ZtYJnHiaOKhjzzVgLB6ie1kTuStIAa03d5SNANWYachRY/Nh4VO8sBhkmuYd8 AX3IHTPC6yWYJqdX/wrMqc8Z7HaXQVHtcy6m0iyTy30m9Iek0MipE+PThWluCYcZp5hI PVyWriYVOoGrGR3QkNeMLY5EcILtNkZuOVN50fPDu302mYLsSeaTzudKyJC9n7IJbGI1 jNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=flWPwsgKsOeJMZ7fcGwHEXD5grUgYIreCikD4ikuhD8=; b=GZVw9wE5ws25Aeb8Ov5iVhAO2ns8OBZ8bVTi232v1W1kP3TRKEvsxIW8J77hJbRgvX sMAdC3qv6Sas+9RuE7XKpeBFLjkvPzIuVFs3dtKTp2N+k3s1LG3fTifLpzCWmBdH80lH HM/9kliW01svUdOa/8D7XzfW79r+AoPh+sc0nu7orJc2LBhoKQho0N99SOLpAf7iTmqI 2Jgh3RlYjgPKwJyVPsiA/tLaxMM6nLd7BV8K4KyvciCOXLuXHtHaqg+JUrJLpCtDg8gW AS/Vsq0qC1uyeS6AhzfrCe6qrpHGpmjjVgDDLj7IbYxpb+fXZtOK8UueHNMIjx+c9H0a pJnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KCYXBnSb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si15588637pgl.268.2018.11.11.15.49.51; Sun, 11 Nov 2018 15:50:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KCYXBnSb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387453AbeKLJik (ORCPT + 99 others); Mon, 12 Nov 2018 04:38:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:38936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733092AbeKLISn (ORCPT ); Mon, 12 Nov 2018 03:18:43 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AADDB21707; Sun, 11 Nov 2018 22:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975327; bh=g6eblRKZ+aTrA5SMwJKQtQ0YFWn8i2riRC9ho0vBDik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KCYXBnSb/M2AGOTgJJXFdFka8OyYntV8MoqRsBDF3iygHpvMMKJ2//Su3JStOiURe twqXNBMEBXcG2PhpVilRROYogz94+iZzCTXVgSU4MSfGsjF1EjDMlO7l9WaVPw/tOs 4S17EiDaRS68vk71WVLxFtrUTDaBIjjaCsybAfjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Omar Sandoval , Liu Bo , Nikolay Borisov , Josef Bacik , David Sterba Subject: [PATCH 4.19 338/361] btrfs: release metadata before running delayed refs Date: Sun, 11 Nov 2018 14:21:25 -0800 Message-Id: <20181111221700.495012291@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik commit f45c752b65af46bf42963295c332865d95f97fff upstream. 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 Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1929,6 +1929,9 @@ int btrfs_commit_transaction(struct btrf return ret; } + btrfs_trans_release_metadata(trans); + 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 */ @@ -1938,9 +1941,6 @@ int btrfs_commit_transaction(struct btrf return ret; } - btrfs_trans_release_metadata(trans); - trans->block_rsv = NULL; - cur_trans = trans->transaction; /*