Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1709817pxb; Mon, 8 Mar 2021 04:37:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwe/7vDbGIe3pqeny1l3m+nRIRt9c1eFkMCE44k7kL0iTvukLiOLEcbqov+mUMPvvKYD8WB X-Received: by 2002:aa7:c618:: with SMTP id h24mr21923779edq.358.1615207041242; Mon, 08 Mar 2021 04:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615207041; cv=none; d=google.com; s=arc-20160816; b=PQKo/N4jZS+Kxqkf5ZYiPbyJoHittVopuJbOe4jmBcgw1LoOibc3SlIaskQ2elf9NQ JUDhHvckCFmqmw/iNw2H8aoBhqFF5IVaX3ZdbzbtU6G/PQtUQgwMLtn+aSiMy3h3/l0b v0E6tYaXtfBk51AqsKeekPccvXnciXuKhQIzG8DVMAznWqhkByFzk9IeYO34KF9Ctski 2US/S/uzCuBuqdLIt3XPLypv32DQOHUWzMLGu2yccH7yWMUgPHSrDQHFC0gDjmfphegI ab5DJMD06dyvISIFW0AviYAmlb/Q6L/whta2FAyjHjxnJbcSrL6OWiCRxadcjQOl+EBP T5eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wNaOqSQJDp/iKyvkQPYBrx0NpH0p+89ngfgu8pr43qg=; b=Q1e9biqraQQVRQY+kgvdEFjMq8WXWxLJpXxcyZXuLwzSgdUA8z8wY1TFs3p0d1XuLm AKx+vF8fwr9+wggjiXm2TNkInUA1a7oEhIF56mCFV8HXcyH3TygL1LtApXe71raAGx1T 42lsNm/RORk7lcZI+oBC06QfAPUF565mu3fKVurKUbFpxVh3IYofdVlMQSqB1fqpUSLO EkVZTwgYxWbCqaU1XLuY1yHpzBQSJaVlX3Y7SQyJAyC4j8aFhE+VPDX7Qcq45fqA3O6c eIxzkvYCgEzDW5un6MEGBzJ3kVvOh9Q5fhAfsXxihlmvUo4mAh1el7TcSSHGsJkcxqgU TWLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZvMwekgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si6751257edm.19.2021.03.08.04.36.58; Mon, 08 Mar 2021 04:37:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZvMwekgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbhCHMdq (ORCPT + 99 others); Mon, 8 Mar 2021 07:33:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:42388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbhCHMd2 (ORCPT ); Mon, 8 Mar 2021 07:33:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57F73651C9; Mon, 8 Mar 2021 12:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206807; bh=vU+pvwp5dlACVFnrSOUzkjpmXmMpOWVu0r+vg3eKMbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvMwekgxUEeD/WmLqWVILb3mPnAuoJj3HJtQrgspLMi36BucoVjOs7Bc0a4EWoriZ 2mXMqnIZgfdlcqPlFBYajUizIbCyFwaEqPyizcASiAr0OGtGKMtmyxYuFjHBCGMO8c sCOAOlBVc9O2GFbdTnAGftQZ7aMSDXbQu2dtGGSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , Nikolay Borisov , David Sterba Subject: [PATCH 5.10 13/42] btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata Date: Mon, 8 Mar 2021 13:30:39 +0100 Message-Id: <20210308122718.784006137@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122718.120213856@linuxfoundation.org> References: <20210308122718.120213856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Borisov commit 0f9c03d824f6f522d3bc43629635c9765546ebc5 upstream. Following commit f218ea6c4792 ("btrfs: delayed-inode: Remove wrong qgroup meta reservation calls") this function now reserves num_bytes, rather than the fixed amount of nodesize. As such this requires the same amount to be freed in case of failure. Fix this by adjusting the amount we are freeing. Fixes: f218ea6c4792 ("btrfs: delayed-inode: Remove wrong qgroup meta reservation calls") CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Qu Wenruo Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/delayed-inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_m btrfs_ino(inode), num_bytes, 1); } else { - btrfs_qgroup_free_meta_prealloc(root, fs_info->nodesize); + btrfs_qgroup_free_meta_prealloc(root, num_bytes); } return ret; }