Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7914365rdb; Thu, 4 Jan 2024 11:37:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNSlunkoGZ65NrTHr6SmIlMps9KpI89C890r9RzA744O9A7QpGQqSEkVPn/1bCJrKoCVvJ X-Received: by 2002:a05:6512:b95:b0:50e:6ef5:990b with SMTP id b21-20020a0565120b9500b0050e6ef5990bmr538710lfv.11.1704397032947; Thu, 04 Jan 2024 11:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704397032; cv=none; d=google.com; s=arc-20160816; b=Ythqxj5bnxD9MWfLCOMfI1eR++lurH2nxubStSncYztTk0MQfLSHWHj856ls5UfLmK 0uxPkgMca8r0iMN6W2jlEV5mh21RQoSu6R/bKwfhhUGsQyz6GE5hDZYL0tYYvtUdDkxD Ow/Y0qMkV2HEuA8Wr4SrVuc5NdZIsrStYQuC+oo2N5l+Ohh3vZAPzqYf+Ku8QQ62B2Q5 Fk9GwQQ53pJ5sGQtl1emsQImm2T9R1zGsyV0wkUetwSwd4kGGcACVzIxrHoWp08hM/4/ 7t25jozDArLrSYaMsNmerml5biXWH7oEcXRGhoJE7iOQlZsxVFxM4quMVZnW+Gbe9VKw YMHw== ARC-Message-Signature: i=1; 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=TLfuV7xsXyW+hLKhxRy2JmANDmog6uIMlY97oe3vpGA=; fh=HF2lR5CWTP5/hM0HOa1oftVSm7g/W7TpRrdzx61ArpY=; b=O8LP30HRgkSktFPR9YmDMNqNCF9VRAJdcLxEQnmTyUOjlRoatFvP2TXAtmB/LnGKe+ b/0XTG7UqxkBt25htptgYlc8b0ytQSHc53OX2OfbRM9Kdu0313zDJObfVLSDQMFzChnz R9VjDGRjk/ZRhtxLQ/29LAKXeuMuzjzn8J+fA1cwHd7OX2+p4GMH698x+r4YOsqBZ0V6 pchOn0JmPLZoNtOw0AbkrB3Dedm+l4Wai42eDyRU4i12/HPewTvkJqCSXpMbrX79Cpvj 4Dr7IId7BosVfkge6hUPHQX/Kr7mgIhlABLZ599TPgZLzLIER/vqqtDUPcSwAEw5Jnfj 14tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fmOjjJ9f; spf=pass (google.com: domain of linux-kernel+bounces-17172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17172-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a63-20020a509ec5000000b0055716150dd2si39779edf.468.2024.01.04.11.37.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 11:37:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fmOjjJ9f; spf=pass (google.com: domain of linux-kernel+bounces-17172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17172-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AB03A1F258F7 for ; Thu, 4 Jan 2024 19:37:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD84C2C861; Thu, 4 Jan 2024 19:35:59 +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="fmOjjJ9f" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 61E002C859 for ; Thu, 4 Jan 2024 19:35:57 +0000 (UTC) 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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40d894764e7so8416375e9.1 for ; Thu, 04 Jan 2024 11:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1704396955; x=1705001755; 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=TLfuV7xsXyW+hLKhxRy2JmANDmog6uIMlY97oe3vpGA=; b=fmOjjJ9fZ+iJn4YSNSK/eJgX9cZ3H3w62EDHYon7+YnT2lIEQFQXj/GBYZb90oAcyq Rzd9/CsODZ5mz/sNjJeIpk1m7ajzHI+yVSeD5RMvpH+B15IyU7SaR+WN0ofc1NK1wZfs 0fTiHiF+RAHO64CccNJcSVTeaToCfSSAPLXG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704396955; x=1705001755; 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=TLfuV7xsXyW+hLKhxRy2JmANDmog6uIMlY97oe3vpGA=; b=v60dKJStmMl1d3T69S+Q1l0CAccGvp6qa3y5RbwszHTDfq/T8XtCRZG2csBu/XF9H5 9V19Yu9N/ovUG5F08zSm5fxhPly6GUjjvffnk43WIRwM4ezzi03Z8nVJRRLwfg7k+4LN 3QZvRH0mSlnYjqjqPn5kx+TnLOAF1SepGL5bn/Seg6u+FkdAdSZ5H2cfGxzfrhi5ebtW 4DaJd1BPcuKLw6z0XU24ELBKlNzEd8zcJGcIkY2dZZ3Ac2t+eZC0WdvxksCTD/owCFZT 9kAR+EHAXbfvwSjOrLboiP84nhruYkIAtlVHzrI4dE/KYwQkzB/wwSwGcIW0izbD3CQ5 kynQ== X-Gm-Message-State: AOJu0YzIcGC7cCq/TdnOT1sHH5BjpBj5C7mpqCWpoGHc5YzRwnQSXBmh OB+QB71AZT+DwTm4P8FRV97VThd4WO+1paagmZUL+KJWl8RZx9pI X-Received: by 2002:a05:600c:c0b:b0:40e:351d:53fd with SMTP id fm11-20020a05600c0c0b00b0040e351d53fdmr377601wmb.239.1704396955335; Thu, 04 Jan 2024 11:35:55 -0800 (PST) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com. [209.85.218.50]) by smtp.gmail.com with ESMTPSA id bg10-20020a170906a04a00b00a26a443e98esm13930367ejb.169.2024.01.04.11.35.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jan 2024 11:35:54 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so105256566b.2 for ; Thu, 04 Jan 2024 11:35:54 -0800 (PST) X-Received: by 2002:a17:906:1194:b0:a28:b79a:37a0 with SMTP id n20-20020a170906119400b00a28b79a37a0mr367224eja.222.1704396954150; Thu, 04 Jan 2024 11:35:54 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103203246.115732ec@gandalf.local.home> <20240104014837.GO1674809@ZenIV> <20240103212506.41432d12@gandalf.local.home> <20240104043945.GQ1674809@ZenIV> <20240104100544.593030e0@gandalf.local.home> <20240104182502.GR1674809@ZenIV> <20240104141517.0657b9d1@gandalf.local.home> In-Reply-To: <20240104141517.0657b9d1@gandalf.local.home> From: Linus Torvalds Date: Thu, 4 Jan 2024 11:35:37 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] tracefs/eventfs: Use root and instance inodes as default ownership To: Steven Rostedt Cc: Al Viro , LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Christian Brauner , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman , Jonathan Corbet , linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Thu, 4 Jan 2024 at 11:14, Steven Rostedt wrote: > > "file descriptor" - is just what maps to a specific inode. Nope. Technically and traditionally, file descriptor is just the integer index that is used to look up a 'struct file *'. Except in the kernel, we really just tend to use that term (well, I do) for the 'struct file *' itself, since the integer 'fd' is usually not really relevant except at the system call interface. Which is *NOT* the inode, because the 'struct file' has other things in it (the file position, the permissions that were used at open time etc, close-on-exec state etc etc). > "file description" - is how the file is accessed (position in the file and > flags associated to how it was opened) That's a horrible term that shouldn't be used at all. Apparently some people use it for what is our 'struct file *", also known as a "file table entry". Avoid it. If anything, just use "fd" for the integer representation, and "file" for the pointer to a 'struct file". But most of the time the two are conceptually interchangeable, in that an 'fd' just translates directly to a 'struct file *'. Note that while there's that conceptual direct translation, there's also very much a "time of use" issue, in that a "fd -> file" translation happens at one particular time and in one particular user context, and then it's *done* (so closing and possibly re-using the fd after it's been looked up does not actually affect an existing 'struct file *'). And while 'fd -> file' lookup is quick and common, the other way doesn't exist, because multiple 'fd's can map to one 'struct file *' thanks to dup() (and 'fork()', since a 'fd -> file' translation always happens within the context of a particular user space, an 'fd' in one process is obviously not the same as an 'fd' in another one). Linus