Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp243158pxf; Wed, 10 Mar 2021 05:30:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLWwGSk2XNM55sD73VVVASbDbkkGUDPp0V3C8jswpbTcXODfowBukDY7U98dAl6+c8fGYU X-Received: by 2002:a17:906:a099:: with SMTP id q25mr3596416ejy.549.1615383036079; Wed, 10 Mar 2021 05:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383036; cv=none; d=google.com; s=arc-20160816; b=GJBnWrp5f6w0sd6GfkbppHZFVZXpfPhAxJWqGPa79THAIwmyLOCW4aKSypKbaJmMBE 0LoywNEOIzUYOnkEwtDYKu7Z36JWXA3zY7eDo4dyWSTN6cHCjfORA3K83fM+b0LBMmU5 aUgRogKyrIVsbU5yE6PVyNV2qYZ2/qUgeHjlCwoSaozRZBHBT6LcsZjJf1At4Ta1lemk BCqqqdI1JvqvWFRjn040MsQPR5jFDy9nXp5EDX505t7RrXkpyiqBMIlyW1WTBDKM5ntp wj4B3QDW8HD2BHrOV9wc27nYoUqRF+uvSK77lDrrevnknlKr5AWDW4RSLqFv+x71NYaB iIWg== 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=r8B4klE8LUYKrzbcJTKGjua/YYQLmsuRZ/LinUeNbEU=; b=YfQQcKwgw9adGn4f6dpofaExxCmqm8Qt12zvTikakh+hXNSGusMYRuMwCBUwv1dv/p CrzxuJn+mSv+YUBF8RyGliVyrj9UQqbi27aAvPg8r0B3RyRD9dZFBj18V+31ksXr21YS MVjeoYvFynWMKCXjzfdrltFBW9JAEKcqCdKl2A9Z/jJvDnUE/2Wg+G5KkmCIjbQmoJU9 UU5hFI5eMhsP/EpcfwiKDVKarsGmD1BzbvrKqkftgXie755sS+CxeUeGRpNLOXXZRRfz 1SsEYTHxwG8E4Ef85t48vIJm1ktAdIADdxoK0mMBo9OzBrZ/EncPr/Px0pAqWukf8rTL b7Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qE9bmfki; 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 w17si1848758ejk.520.2021.03.10.05.30.12; Wed, 10 Mar 2021 05:30:36 -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=qE9bmfki; 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 S233883AbhCJN1Y (ORCPT + 99 others); Wed, 10 Mar 2021 08:27:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:46488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbhCJNY7 (ORCPT ); Wed, 10 Mar 2021 08:24:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0243A64FF4; Wed, 10 Mar 2021 13:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382699; bh=FeRVY0rVDHLoX6Xkb15Dp53Q/1Q+zVP1AiO/fqTJZ5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qE9bmfki+0G0Jy/sD3wsX4U1yFlsERVz7xsFkPeKvSL7ubgJhyK4OSL4mOlp6oUy9 gVtAmcvdWYw/teNGZdxMII6eC0vSa+aLmF+UFKACgHBvExQ9qHaG/PGKsFLOEoHuUn 1KmJ5j57CjB8ZLoXHn5fRv667gKPruzuYstJS5rE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , Nikolay Borisov , David Sterba Subject: [PATCH 4.19 04/39] btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata Date: Wed, 10 Mar 2021 14:24:12 +0100 Message-Id: <20210310132319.865687239@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132319.708237392@linuxfoundation.org> References: <20210310132319.708237392@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: Greg Kroah-Hartman 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 @@ -642,7 +642,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; }