Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp870343rdb; Fri, 26 Jan 2024 13:26:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbSCdFVRcotN7HbQheUoTL+zycfPH37+xL97/LcMtJ8xI7ewdxjFqIe37NvrjqU5CE1F4L X-Received: by 2002:ae9:e645:0:b0:781:ed01:f5e7 with SMTP id x5-20020ae9e645000000b00781ed01f5e7mr391271qkl.143.1706304395890; Fri, 26 Jan 2024 13:26:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706304395; cv=pass; d=google.com; s=arc-20160816; b=triPw46dNeaSl7JzX98qbsodib7aKd121L2/wDkhuGE1zvY9MAlqAcmguYObrNAWsK NA1BbNbaqsDu2j5RcgUAbng5iTrOEi2AOl3LiM3j8bipPlQG/N5P5vL0x8ARuudHrkRP dOLK/P5BVaVQ9H9fXzr7gv9iA178uLtc2RZAz0JmgI5EPn6ZJVwt16x4DzXtS7sl7edF wWEP/Lcjpq4i+bUdCflTuxUQsEgG5Y5fzl0GYgyTkaTB+VQmhCyi7zzFIauVORViy6+/ mDpH58hzDB2Dt7LJorHL01aR8lV9h5+etJPkkrmSpC1+LDngr/F21WwWzuJDSOw679Kt 3YQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=Y4X4XebuY+/qJW5g4LE1XO63HkQkQRYCmuYDaj9CpNQ=; fh=WlcU4g8Jb4Aym7g9yaIirX5y5dumxg7zHygtim3aB78=; b=ZSd4+VHaqfhg0fnpCTfY9LtWcN/9IY0fwMUsIykao/VXxamHK7jCd34zoi7H31zWe3 ve1v0PofKZclnre6p6DC58lsChRoG0SlBK6xc8s1PXBvKVsoX1bXPXCiZMkuQ058lRP/ EEEVhDmjhBQbMlijy6JNmUVN3N9T7zxyHTG/r7Sg0Et6DndVI06oTI+2O+iao8st0xax 9omCaVLrgZBjb5R6nPtjFajtvVgKvGm1QebJvKPGUVWb3NS7crJHeLIXkKNuefOfSxcZ EdfEwJM4Bs6iD4lZnCJ9ecKRyvLTXsv9qOX4J99gxya8gjFP8UiIMv1ua/05/S7A9mSk 93Dw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-40670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40670-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z28-20020a05620a261c00b007838dd98172si2440967qko.457.2024.01.26.13.26.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:26:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-40670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40670-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A58341C20FA2 for ; Fri, 26 Jan 2024 21:26:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490C524A0F; Fri, 26 Jan 2024 21:26:26 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDBA4249EA; Fri, 26 Jan 2024 21:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304385; cv=none; b=PL7zCA697Te1gG5ZX5Y/U79buhndpGSza1oeIbbyxy5GaUHJGJPD29LSzilSH5iFDe0uqpiuIVGg/w7xgVqlwlmnkXauUtFKa4beF8UkhZSqZIGDPBLfzYjtpSsf/gPJhfpZWbb6ShTBSgqTC7eztQJ/gQv9rADrn107lWw2gB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304385; c=relaxed/simple; bh=eO2PbaoyRZQ7eFdXYsMoTI8zvWtJ7nAM+Z/kZ5vVv24=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TfRhqEo1BhWiygswrfa9/FrnFIvK5urQN/ON5yw3p2wwXpYDclv+6DyVwUXBWahF2L5s4Ymfefeqc0ymVMSZhu6GNEh+9sMVjoy/0PfP1Bl3EBE5Ts8vhINjMQ17+cKEZouQTb7F3EB+Fhqk+dq2rPm38OfwpQb9DPG6wQNqtYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37A25C433C7; Fri, 26 Jan 2024 21:26:24 +0000 (UTC) Date: Fri, 26 Jan 2024 16:26:26 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Linux Trace Devel , Masami Hiramatsu , Mathieu Desnoyers , Christian Brauner , Ajay Kaher , Geert Uytterhoeven , linux-fsdevel Subject: Re: [PATCH] eventfs: Have inodes have unique inode numbers Message-ID: <20240126162626.31d90da9@gandalf.local.home> In-Reply-To: References: <20240126150209.367ff402@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 26 Jan 2024 12:25:05 -0800 Linus Torvalds wrote: > Steven, > stop making things more complicated than they need to be. > > And dammit, STOP COPYING VFS LAYER FUNCTIONS. > > It was a bad idea last time, it's a horribly bad idea this time too. > > I'm not taking this kind of crap. > > The whole "get_next_ino()" should be "atomic64_add_return()". End of story. I originally wrote it that way, and thought to myself that the VFS version is "faster" and switched to that. My fault for being too much into micro-optimizations. > > You arent' special. If the VFS functions don't work for you, you don't > use them, but dammit, you also don't then steal them without > understanding what they do, and why they were necessary. > > The reason get_next_ino() is critical is because it's used by things > like pipes and sockets etc that get created at high rates, the the > inode numbers most definitely do not get cached. Yes, I understood why it's optimized, and took it because it's been there since 2010 and figured it's pretty solid. > > You copied that function without understanding why it does what it > does, and as a result your code IS GARBAGE. > > AGAIN. > > Honestly, kill this thing with fire. It was a bad idea. I'm putting my > foot down, and you are *NOT* doing unique regular file inode numbers > uintil somebody points to a real problem. > > Because this whole "I make up problems, and then I write overly > complicated crap code to solve them" has to stop,. If I had just used the atomic_add_return() is it really that overly complicated? Yes, I copied from VFS because I figured if they put in the effort to make it faster then why not use that, even though it was overkill. > > No more. This stops here. > > I don't want to see a single eventfs patch that doesn't have a real > bug report associated with it. And the next time I see you copying VFS > functions (or any other core functions) without udnerstanding what the > f*ck they do, and why they do it, I'm going to put you in my > spam-filter for a week. > > I'm done. I'm really *really* tired of having to look at eventfs garbage. So we keep the same inode number until something breaks with it, even though, using unique ones is not that complicated? I'd be happy to change that patch to what I originally did before deciding to copy get_next_ino(): unsigned int tracefs_get_next_ino(int files) { static atomic_t next_inode; unsigned int res; do { res = atomic_add_return(files + 1, &next_inode); /* Check for overflow */ } while (unlikely(res < files + 1)); return res - files; } If I knew going back and copying over get_next_ino() was going to piss you off so much, I wouldn't have done that. Not to mention that the current code calls into get_next_ino() and then throws it away. That is, eventfs gets its inode structure from tracefs that adds the inode number to it using the VFS get_next_ino(). That gets thrown away by the single inode assigned. This just makes it more likely that the global get_inode_ino() is going to overflow due to eventfs, even though eventfs isn't even using them. I only did the one inode number because that's what you wanted. Is it that you want to move away from having inode numbers completely? At least for pseudo file systems? If that's the case, then we can look to get people to start doing that. First it would be fixing tools like 'tar' to ignore the inode numbers. Otherwise, I really rather keep it the way it has always been. That is, each file has its own unique inode number, and not have to deal with some strange bug report because it's not. Is there another file system that has just one inode number? -- Steve