Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1186131rwb; Thu, 8 Dec 2022 07:41:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5IgnMCqsJkJSZ3If5SOnPKWbL/WiCWTA4lTBp3i1NQuBtsnKnaQeamAI3FX2hcRWtjFJ0C X-Received: by 2002:a17:906:3849:b0:7c0:9d75:46ac with SMTP id w9-20020a170906384900b007c09d7546acmr2201987ejc.24.1670514096239; Thu, 08 Dec 2022 07:41:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670514096; cv=none; d=google.com; s=arc-20160816; b=DeyHWwhQz/uCO8waXSBMgvKHRd37WvdeFgDvc3VkNkC6faGO/bMDAJ3iFlvX/8EUW+ +VnavDYlNmYQ969Mk6BwWL4uqgOssV1lcSlDQgSpEZZFKEWeA5uycA7VhEwa/NpWv6YA 2H0BVMgUNmL3bd7bSt2D3uopUhbCylNbW3WJORa2ruMSTzvI9IzfUnADmb+gj+71cI9H XC4lFEuBXzNSBP/H5SXX2F3bd/LuHh3rD6Cxbg/vyl1JrC2lZh7KzTze3OiMqs5KaVFA YdJsdASJUI6q2Q9OZhVs0QfHoalmkgEVwTI9VyYmkAcLryyW8aj6uaMKwc5lXBFK6C/T jt6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=69C163rhbG+6KT0oaec3E5RjFCQQ6U3oPgXAAoCstXk=; b=TKZeXF8GngNjTxzNtxQHmgZQRHwo2qMiw1orrp5Qzst6hqHkpgSVx3unSFTOIRNQ/g 2rRRYHzAoRD/BDNqJbHhfFHChIo5tLb1TlhkTVRMYvXDRT6I3fQPk9+iWPuNlNU4tKBE 1191AnNYS2qGhR6Yh4uFvo1d4+69fT/yYyvgq5HIag7HjaTTNZsyceJu370NALJ0LRn1 z//atPTgiJbEWifYEoO5Gs4DQtj8TByURazIepumXNC+Sw3POb3Q3E3QhkBLgaWXY3zO /JjdHGFBQu6wr4bxwiWj/stx+V4Y8CzmS+IK4iwnpO3hZn1PkM5boPD3N+edBh0ECvSu etDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=BeMJDct5; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp19-20020a170906c15300b007c0bc7057e9si17253155ejc.582.2022.12.08.07.41.10; Thu, 08 Dec 2022 07:41:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=BeMJDct5; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiLHPkY (ORCPT + 99 others); Thu, 8 Dec 2022 10:40:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbiLHPkO (ORCPT ); Thu, 8 Dec 2022 10:40:14 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63CE8B68 for ; Thu, 8 Dec 2022 07:40:07 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 2B8FdpFn004109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Dec 2022 10:39:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1670513994; bh=69C163rhbG+6KT0oaec3E5RjFCQQ6U3oPgXAAoCstXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=BeMJDct5Nn8W9MUec75hie7Ta+R0uOft0TCOCl/sC3bcK+DINybV61quBWp8nBZY4 n4CGvE7iGGGooOStJDw+FnCi0o8nOIDJ6ywuKahsQcKKwwqOHDp+5ytFDHqKLc5J8W GcRr1MP1Yc1S+lQoN7DTbAnRU1Vu6Y495zWSMvRA6zb3Q6FIf/JiwbZ+H3VFpztpDN OA+557NZqpE5oX/1/2FApRnBvoTqxygCmmm6TnRVEbct96OJhkt/HWyBT0ewze5pRF tdzMHCgdu6MulQa0iiQh50Sm+6OQm0TJpu7KxUPRkMmhlzUk2tveE9EtvdvS6CBAvQ 24sb7Ae8c+2CA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id D5B2015C39E4; Thu, 8 Dec 2022 10:39:51 -0500 (EST) Date: Thu, 8 Dec 2022 10:39:51 -0500 From: "Theodore Ts'o" To: Jan Kara Cc: Thorsten Leemhuis , Andreas Dilger , linux-ext4@vger.kernel.org, stable@vger.kernel.org, Thilo Fromm , Jeremi Piotrowski , Andreas Gruenbacher Subject: Re: [PATCH] ext4: Fix deadlock due to mbcache entry corruption Message-ID: References: <20221123193950.16758-1-jack@suse.cz> <20221201151021.GA18380@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <9c414060-989d-55bb-9a7b-0f33bf103c4f@leemhuis.info> <20221208091523.t6ka6tqtclcxnsrp@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221208091523.t6ka6tqtclcxnsrp@quack3> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Dec 08, 2022 at 10:15:23AM +0100, Jan Kara wrote: > > Furthermore, the fix which Jan provided, and which apparently fixes > > the user's problem, (a) doesn't touch the ext4_bmap function, and (b) > > has a fixes tag for the patch: > > > > Fixes: 6048c64b2609 ("mbcache: add reusable flag to cache entries") > > > > ... which is a commit which dates back to 2016, and the v4.6 kernel. ?!? > > Yes. AFAICT the bitfield race in mbcache was introduced in this commit but > somehow ext4 was using mbcache in a way that wasn't tripping the race. > After 65f8b80053 ("ext4: fix race when reusing xattr blocks"), the race > became much more likely and users started to notice... Ah, OK. And 65f8b80053 landed in 6.0, so while the bug may have been around for much longer, this change made it much more likely that folks would notice. That's the missing piece and why Microsoft started noticing this in their "Flatcar" container kernel. So I'll update the commit description so that this is more clear, and then I can figure out how to tell the regression-bot that the regression should be tracked using commit 65f8b80053 instead of 51ae846cff5 ("ext4: fix warning in ext4_iomap_begin as race between bmap and write"). Cheers, and thanks for the clarification, - Ted