From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BF0EC433F5 for ; Tue, 12 Apr 2022 00:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244126AbiDLAwX (ORCPT ); Mon, 11 Apr 2022 20:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244281AbiDLAuv (ORCPT ); Mon, 11 Apr 2022 20:50:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10AC30569; Mon, 11 Apr 2022 17:47:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 301C2617DA; Tue, 12 Apr 2022 00:47:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDEBAC385A4; Tue, 12 Apr 2022 00:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649724421; bh=rmjgKGSl6FAX7UG+a6UyWoOzWwQbxpreIb5n5T+/TgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSi3oXRst6VHTH8Qu7kH0UXIPeDiiGLpr+Oy6IEDO/4XJLmoaqwXs5qUlpuUapnVj 4ByxOa44T7XFzn/rk0zhv7Qwh7ksTq08Eg70v1mMNlDeUA0hZODvh7rnMCKXTKsZCa Rdsldy54DTxT+DYMrZn9AQv0YELa8YigVAhqCqMC28MhTt53tEl9Fi0edijbnFSx+D +gBxsYsBuIzfUtyDU78J8tvVSuFUec5sQj+8WBNcKNcZn6iV377ZViL8k2yuov7MfL UzEcXBh6Lh6K0hYOMrB6DPSNj9/kJQ1TvKGojtC8Dvt9sv9149VR19wEgz1mVrabz4 sUlUUYmrBdRvw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Josef Bacik , David Sterba , Sasha Levin , clm@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 03/41] btrfs: do not warn for free space inode in cow_file_range Date: Mon, 11 Apr 2022 20:46:15 -0400 Message-Id: <20220412004656.350101-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412004656.350101-1-sashal@kernel.org> References: <20220412004656.350101-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik [ Upstream commit a7d16d9a07bbcb7dcd5214a1bea75c808830bc0d ] This is a long time leftover from when I originally added the free space inode, the point was to catch cases where we weren't honoring the NOCOW flag. However there exists a race with relocation, if we allocate our free space inode in a block group that is about to be relocated, we could trigger the COW path before the relocation has the opportunity to find the extents and delete the free space cache. In production where we have auto-relocation enabled we're seeing this WARN_ON_ONCE() around 5k times in a 2 week period, so not super common but enough that it's at the top of our metrics. We're properly handling the error here, and with us phasing out v1 space cache anyway just drop the WARN_ON_ONCE. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 58053b5f0ce1..f270729a325d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1075,7 +1075,6 @@ static noinline int cow_file_range(struct btrfs_inode *inode, int ret = 0; if (btrfs_is_free_space_inode(inode)) { - WARN_ON_ONCE(1); ret = -EINVAL; goto out_unlock; } -- 2.35.1