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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 438B1CCD1BB for ; Wed, 18 Sep 2024 14:40:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8CCA6B0085; Wed, 18 Sep 2024 10:40:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B3C4E6B0088; Wed, 18 Sep 2024 10:40:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A047B6B0089; Wed, 18 Sep 2024 10:40:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8088F6B0085 for ; Wed, 18 Sep 2024 10:40:50 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 364F6A0644 for ; Wed, 18 Sep 2024 14:40:50 +0000 (UTC) X-FDA: 82578120660.24.4F6BD3D Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf04.hostedemail.com (Postfix) with ESMTP id 133EA40004 for ; Wed, 18 Sep 2024 14:40:47 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=MbN3Uv8o; dmarc=none; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.43 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726670438; a=rsa-sha256; cv=none; b=yM35yXRX7Cyg1gzAh/TJOrMPUbRpmut4jk7Xw3h4+yaceVKM0PFZ0ScfjYVxhxgFklk7FV 1amorV8X9jSH5jfSfNAHE4bnIYAlpDsMi4VP/aTxnNyY8EVTrQCHLlCyBntspBTVaG+HdP UuxVPM5+Ymj2JpeMu/utTr5UwIppUUI= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=MbN3Uv8o; dmarc=none; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.218.43 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726670438; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2t1ItWJ3ig5qNarueJWrYx/kj01x5BbGfjJ8rjmQF4o=; b=hzNgQ3ytJzFDERsWfjlyqZMASi9NXBLbR3mmU3w5cg3Wf3PfkK38JNNLNGSfnuOgb6kDWK taJxj2NI1tPc1tlgLI+qNZEsrjp/l7LvwxQuR7tr++uiTSKpAOjoE/9BeWpREPSyCzm6bU KwuHGi3qMLNLD0Rs0J8gXuUI3FlDluA= Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a8a7596b7dfso153805966b.0 for ; Wed, 18 Sep 2024 07:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1726670446; x=1727275246; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2t1ItWJ3ig5qNarueJWrYx/kj01x5BbGfjJ8rjmQF4o=; b=MbN3Uv8oP3crK8SbwSgqfTbDh6lHxh14wiAeqAGPSXAJLbBx6ECuq+hewWthiiebjk Ji6bhw8hvHUVGB3w3jgpowiCYgRe6nWjMwJZrlyic04A/M8l1Wpg8wP4oGKmvo+ZyPw/ WobZBGwVzAshFkokS+VFobkoWFR8+QZ0R2/YM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726670446; x=1727275246; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2t1ItWJ3ig5qNarueJWrYx/kj01x5BbGfjJ8rjmQF4o=; b=dZYpCCGM3879RlnoMj3eAcnugDfO7WhI8sb0Cb33zsMn1bemKmauuzkF66kycEd6sS 8qHFe61WKi/odlEzaryTicz0Pw4cbv971BJ93odebz/6yaGdtMqHfC7PtL1HBSK+EsOA BTLPGuVKfo6DPXQF+0tuePQMJJJdyE7+QMDpNUaOWiofjROCi1wCOnm2/x1KgN7DKDcC SoQV8g88nuzjgdCwMw8HuRS/dsxRf2SKQ2kwMm3aCEkWhNXI8dtnXNfKu7lcjby7mdmP TG0kTeSYAtINLzYKuM6Tnk8uFNXskzyzo8I5FhocBG8AQhCaBGCLe+z8o+oNlcyn7VbS 8/7w== X-Forwarded-Encrypted: i=1; AJvYcCXTdcAaVjTQPLREBJt2HLxhgrVBB4lAw4vuN97bVm+npE09wGJcew0ZQdFNaxU+9wkeKEcdIkt0+w==@kvack.org X-Gm-Message-State: AOJu0YxWxQ9WUtSQf+w8JmOzg4Zm8HB02Sl3ayutkkUwL3tujNazi7WE dyNHoYGTfuq3XxdorZ3aHBOzf+azlEgnyi8aCQVzlg7NSXSveZ7jjncDL6yBoMyt6nleENpb64W na+72hw== X-Google-Smtp-Source: AGHT+IGxvzeg7JHZHLccKuGTCkI5BDoTei6dwa20fWVZA0uxNuI+VRSkZmY229SrhKQsUUF7NVKP1g== X-Received: by 2002:a17:906:fd88:b0:a72:7ede:4d12 with SMTP id a640c23a62f3a-a902a3d168amr2321414766b.5.1726670446400; Wed, 18 Sep 2024 07:40:46 -0700 (PDT) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9061096a34sm593190466b.24.2024.09.18.07.40.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Sep 2024 07:40:23 -0700 (PDT) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5c241feb80dso1810978a12.0 for ; Wed, 18 Sep 2024 07:40:14 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUlTv8yf41AXGge8A2lckXBtsKPIkZvKE5LfSDJVt9VHcMJn8YuqiSJ9ZaeoOi1ARhDNkC5fIUljQ==@kvack.org X-Received: by 2002:a05:6402:2189:b0:5c4:178a:7162 with SMTP id 4fb4d7f45d1cf-5c4178a7270mr24593373a12.19.1726670413894; Wed, 18 Sep 2024 07:40:13 -0700 (PDT) MIME-Version: 1.0 References: <74cceb67-2e71-455f-a4d4-6c5185ef775b@meta.com> <52d45d22-e108-400e-a63f-f50ef1a0ae1a@meta.com> <5bee194c-9cd3-47e7-919b-9f352441f855@kernel.dk> <459beb1c-defd-4836-952c-589203b7005c@meta.com> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Sep 2024 16:39:56 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Known and unfixed active data loss bug in MM + XFS with large folios since Dec 2021 (any kernel from 6.1 upwards) To: Matthew Wilcox Cc: Chris Mason , Jens Axboe , Dave Chinner , Christian Theune , linux-mm@kvack.org, "linux-xfs@vger.kernel.org" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Dao , regressions@lists.linux.dev, regressions@leemhuis.info Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Stat-Signature: tutyj1bn4z9xcxqp746bew4c9wy5s4pn X-Rspamd-Queue-Id: 133EA40004 X-Rspamd-Server: rspam02 X-HE-Tag: 1726670447-608554 X-HE-Meta: U2FsdGVkX18EfmyHz1QK9wnXk/sLi67fM5ZuDfhJX6Y/GwDGKuv3mBRuxU5vhTQAOSi05RXAsnWIu50YATIKBDPvO7db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v+3loiu3GbDAwDUtg05jifF/oyxDib0Y+zg7AjxnkmTZe6OP2xji8XrxAPPWytK2SdF0wLaMaPbywx+UgMbYCLeAvjpCmY1aOBZ/JkuQFx+jzIXaeCTSQHDcX+FFlC0va1qpShR4R6hxIU0nlePvD2JrXnJcTLB1+UC9MSCh8iYJAPBe0apdxWLedkWDMPl4aawQVpozzBqCIo9vStWMhrXb8/E+4w6jBQMri2oFic+5CeoyDk+wIC+x8tz7GCN2T8J/VtxOmncD1a0VIsgsYh0YXMHozULI8GP3ep1+aw41IaQAIMYAP1SlgNScL0o2Xl9vL16bvgezWrCmprP5Q2skddfiX03klUe+mNOQB678TmsBVzVg9XsD0NfG3f32xJ3WhJ7vCyuLPjGFBIg/AdOWUqmW31AulcAx98w8P2EzCAbZErvu5t+TUXp/neWcsouH8bWW4CwlwxUlEYbdHGyAs5WiImEsuwbEyTJCmUtsCp2hKJfKxwwH+lLWIj9vaFX3F+c1Q/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 18 Sept 2024 at 16:12, Matthew Wilcox wrote: > > > That's actually OK. The first time around the loop, we haven't walked the > tree, so we start from the top as you'd expect. The only other reason to > go around the loop again is that memory allocation failed for a node, and > in that case we call xas_nomem() and that (effectively) calls xas_reset(). Well, that's quite subtle and undocumented. But yes, I see the (open-coded) xas_reset() in xas_nomem(). So yes, in practice it seems to be only the xas_split_alloc() path in there that can have this problem, but maybe this should at the very least be very documented. The fact that this bug was fixed basically entirely by mistake does say "this is much too subtle". Of course, the fact that an xas_reset() not only resets the walk, but also clears any pending errors (because it's all the same "xa_node" thing), doesn't make things more obvious. Because right now you *could* treat errors as "cumulative", but if a xas_split_alloc() does an xas_reset() on success, that means that it's actually a big conceptual change and you can't do the "cumulative" thing any more. End result: it would probably make sense to change "cas_split_alloc()" to explicitly *not* have that "check xas_error() afterwards as if it could be cumulative", and instead make it very clearly have no history and change the semantics to (a) return the error - instead of having people have to check for errors separately afterwards (b) do the xas_reset() in the success path so that it explicitly does *not* work for accumulating previous errors (which presumably was never really the intent of the interface, but people certainly _could_ use it that way). Linus