Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp602130rdb; Mon, 29 Jan 2024 11:54:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmaoo7a6PG8UtC5Qlvai4Buh4OqxaNwvPGmZmbmw+DnwgBuWd94tyf2rSeo/jyCdPQTuXK X-Received: by 2002:a17:90a:1346:b0:290:2c1:4a13 with SMTP id y6-20020a17090a134600b0029002c14a13mr2678413pjf.39.1706558065506; Mon, 29 Jan 2024 11:54:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706558065; cv=pass; d=google.com; s=arc-20160816; b=WYOZTh5mZz4XQLuCWaV8qnfN9R0lo5uf3tinUhat8IcQSj/phTI8FWxMVHcxlh5cfW 87rPuvYaCceIsu5pgpwQzet5D4eyR5NOMhNcBHpEpvJcu5fHaFmkJgSbrLU36qBHdjOE 3S0rF/Py3+4j0oY9BXDA5ZF6+Bf8dTQdHrOf59OBgYvTQjY9T+3CnJnDWt0LDQpahvZA 7hc4oFF5yEmsqtlq9q5/PjdpR0+ftW0z1/Hn9IhSZXEhr1zicz7WpC5JL6E0ohZmNHFi 0lF0RFuWt5sLa/ZT0PArS6MRBn5e3/p0HS+52J5RUGHoY7/dbhmf/KP/dmT3k3+SoEEA aHNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=POvQx/OtzDWk0KpZLv1n2MuJ9LedkHIMhddtK9sWv5M=; fh=Md50wLehZoDD5Sx7nueCG/UN4tfSAivmPz4nrPW3cUY=; b=lCn+R0vIXbGeLONZlpftFOI7qc9HBTpDynJJS249eCkAI6sFMu/zzzV8jwqLrUUftM 1qK33DphavS05kxkPNBpuA95UK6gm0f93q5OnrpkTYkBQrualTjGljcLBdCMXNDxv+Vu vG2YPj7mYLPSuVuCAgJmFIf/aCWh9DQe47S1ybxWJDfpTTWTZCC8ANRvY+RM5/FLL3NI d8T1gJYqW5LCCK1szQUP9NJVGdrJJvBgXt6lrKAlIC0F5k0Dnp0yCH03/3hMK7sehO1Z K7t2a+mDWUu4M0lZOT+LeXlWjvIt92SqHZgqN585pYO+HzVagHOsKARfk8c0HpS7//Z9 KFLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=e+F+XGcc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-43428-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43428-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v20-20020a17090a899400b00292e3004eb0si7275582pjn.152.2024.01.29.11.54.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 11:54:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43428-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=e+F+XGcc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-43428-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43428-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BA9AB23D88 for ; Mon, 29 Jan 2024 19:52:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94D0E6F08E; Mon, 29 Jan 2024 19:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="e+F+XGcc" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD3386A008 for ; Mon, 29 Jan 2024 19:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706557934; cv=none; b=NAPszr2yRZHnGkkTYq/weYEVqPXAKSqbAPO7w7qfUppFWkggQD+HY9y50xa+dtgFZPOM2lP4yjbig3ItISLmzVFvaTkhOtkYvQhVX8o3nRCUueX+92CqQZNbQXCMk2PbXgEPBPDRhtHpkmGWqNDR0keRevfw43W42HBuAD2kdXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706557934; c=relaxed/simple; bh=+U42MXYQmyPm0YLTZYN6+NqwTBjYG5RX5rdbE3Yhuts=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sIxxgwU4R1epDTwmTJ94nmLmj5iIFJ67MlUsuROHX/Y3go4YLYI77VsemPQpiyowS9n7bDDpbvTBS9N5rdSCPx1xuU2obWMKJxvK+kgMxmRNBT+29re1krCkj4HChpbt9If/Ifb0fb+YKAXLcVcpmdYgJkFk1ET3q4wwegt/eqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=e+F+XGcc; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a3122b70439so426057166b.3 for ; Mon, 29 Jan 2024 11:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1706557930; x=1707162730; darn=vger.kernel.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=POvQx/OtzDWk0KpZLv1n2MuJ9LedkHIMhddtK9sWv5M=; b=e+F+XGcc/Xysiz2RY2vioan6Fq+ZZyXzafhL04gc0yqdKBiWsZJUgzpRmc/NB+j5vQ AmZMfM4dGL0OXsaCkqsA12Ihcvm8JfEDaub+jQyUKzWZwj82HSQpa5UknJmU0V4t/QUp gppgh7VO8u9Y1JXAJlaPK8MB5GF8WN96C5O+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706557930; x=1707162730; 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=POvQx/OtzDWk0KpZLv1n2MuJ9LedkHIMhddtK9sWv5M=; b=PaHIfndQxoWgKp9rvl1WJDivZg0XxI1nUbjosYQF7BGf7nKdB4asg4/hMNZjGm4eli XuZS4t255vD6QBy8ByD3it5CJ9RKFH2HAbFn0ttLc9XeJrd/vzINBcRgKbd7MCPF0iT4 7sUY0iXJwaVloyfgEwK64Vnx9eI9K8Z5eMVnCQbJjWFxUq+UStsioJLBWfGDRJxHpgJE TF4GeoYiU/gkq/pRXh3/9POIs8blueMeyVKFfVAB9t5+MI4ehWTkQcNJlPYW790puorc huvdqCNdqla/bo+sYyCq6LfiHZVS3Fe+9gbTRD3h+smUtqUEYD4rcP00NerB4z8Tc6eL sgIg== X-Gm-Message-State: AOJu0YxA9//osY6QN8PH3cREQQ4uIRWia1EMKcM84zA6j/f1eBTQsZ/5 qdYDzdzxtVQ6576ktsW7528EcbNVckI0DOHHaL1h9RiyqC2lu605F+yNPvuJvIbxHbVyrJ4A8pa fH4A= X-Received: by 2002:a17:906:848:b0:a2c:b5a1:f8 with SMTP id f8-20020a170906084800b00a2cb5a100f8mr5631512ejd.37.1706557930209; Mon, 29 Jan 2024 11:52:10 -0800 (PST) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com. [209.85.208.54]) by smtp.gmail.com with ESMTPSA id pw18-20020a17090720b200b00a35c1d11621sm1237876ejb.131.2024.01.29.11.52.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 11:52:09 -0800 (PST) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-55f15762840so1060825a12.0 for ; Mon, 29 Jan 2024 11:52:09 -0800 (PST) X-Received: by 2002:a05:6402:51ca:b0:55e:e838:a20e with SMTP id r10-20020a05640251ca00b0055ee838a20emr3923739edd.25.1706557929185; Mon, 29 Jan 2024 11:52:09 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202401291043.e62e89dc-oliver.sang@intel.com> <20240129120125.605e97af@gandalf.local.home> In-Reply-To: From: Linus Torvalds Date: Mon, 29 Jan 2024 11:51:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address To: Steven Rostedt Cc: kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Christian Brauner , Al Viro , Ajay Kaher , linux-trace-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Mon, 29 Jan 2024 at 11:24, Linus Torvalds wrote: > > So the patch was completely broken. Here's the one that should > actually compile (although still not actually *tested*). Note that this fixes the d_instantiate() ordering wrt initializing the inode. But as I look up the call chain, I see many more fundamental mistakes. Steven - the reason you think that the VFS doesn't have documentation is that we *do* have tons of documentation, but it's of the kind "Here is what you should do". It is *not* of the kind that says "You messed up and did something else, and how do you recover from it?". So the fundamental bug I now find is that eventfs_root_lookup() gets a target dentry, and for some unfathomable reason it then does ret = simple_lookup(dir, dentry, flags); on it. Which is *completely* broken, because what "simple_lookup()" does is just say "oh, you didn't have a dentry of this kind before, so clearly a lookup must be a non-existent file". Remember: this is for 'tmpfs' kinds of filesystems where the dentry cache cotnains *ALL* files. For the tracefs kind of filesystem, it's TOTALLY BOGUS. What the "simple_lookup()" will do is just a plain d_add(dentry, NULL); and nothing else. And guess what *that* does? It basically instantiates a negative dentry, telling all other lookups that the path does not exist. So if you have two concurrent lookups, one will do that simple_lookup(), and the other will then - depending on timing - either see the negative dentry and return -ENOENT, or - if it comes in a bit later - see the new inode that then later gets added by the first lookup with d_instantiate(). See? That simple_lookup() is not just unnecessary, but it's also actively completely WRONG. Because it instantiates a NULL pointer, other processes that race with the lookup may now end up saying "that file doesn't exist", even though it should. Basically, you can't use *any* of the "simple" filesystem helpers. Because they are all designed for that "the dentry tree is all there is" case. Linus