Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp290638rdb; Sat, 27 Jan 2024 06:47:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwaoang8kc+i778KqMpjy7siMyoqsRFEPVxzMb22qgcmw1CMa8fka/0vLhY9S0tTEP1n02 X-Received: by 2002:a05:6214:4008:b0:685:2233:678d with SMTP id kd8-20020a056214400800b006852233678dmr1683357qvb.27.1706366852726; Sat, 27 Jan 2024 06:47:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706366852; cv=pass; d=google.com; s=arc-20160816; b=sUwfQtDrQtC2I14rfGZIhZnffP7xmqjOlWd1hswIlJTkNixc1cKX+sfu0sRRmkyp3D 7hKCErlt4GMxYIXZsITh/h2Ho2y5U3ReWvgdoGgloclVvr65op1G4DGsZghe8UpQklrm GBObSBihL5/rmVS1Tb9TtTaoZ8s3w/K+hXyUoudrVSckQeNssGAz87KeSO0SqinvYsZx dOAiVustX4fhGL8om3w2PuKzVq+yKNXjGnCqO+M6u94GqPRVAESTHLV+bzdk1xoJnW1e VtqnUzwhmANUT/v16BZkwyOkPH9iN7EqlZOkjbzgQOr1XuILqXWEGozfflHPsJntQtar I+2Q== 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=FZLyxs2KTnrtcfMD37K8ga7IQTtn1kDf3zqroJHBu0I=; fh=WlcU4g8Jb4Aym7g9yaIirX5y5dumxg7zHygtim3aB78=; b=DMHC/t7gNpYNMd9HdaIkO5YZ+E9ZM/+oGNv5ZSDsotDVWjqYJu8i0R89nsVxR80Iol tf6sSbO/Ikr0+dply4khy4Ry9Dy3SqD/tPw7o39z1y8dfmX2DKiemugXLFQ2+YJQPFoU 4wqKOzcV2RgpyA66C/1s2mjNOgoRP/iYa8ekl2pmp+CMXQQMDJyHoFQrvMLJNP3V36AC k7YfVDaE8vybrFwDgrvIu0OlZQ9UIS1TLWHEUVIW15s03mJYRWdPlhcQfItGqygh2jb5 XO5qE4ilOjg7FRkWWyFGlp1iAZcB2ExrNqNQ1/ATzJz4RJ/DVAOK1lixcMhEY7/cSjHu xlJA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-41228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41228-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 7-20020a05621420a700b006854a852bc5si3777484qvd.556.2024.01.27.06.47.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 06:47:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41228-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-41228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41228-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 5B91C1C21BFF for ; Sat, 27 Jan 2024 14:47:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9DCE28DBD; Sat, 27 Jan 2024 14:47:22 +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 621CF1E4BC; Sat, 27 Jan 2024 14:47:21 +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=1706366842; cv=none; b=bczmnJ0xowbzkTOZ5L2KX+/sprQL33Y25w8gO5mBuoOE1f3TEVx08VHf9f2E8m6TaFONd5SX8ijTnmjCTPzSuaxqV3v2+2EnfAQJq8RZHOYh4xDFvIjYLavr2eW51+AODEbNCN2t7m+FbocqASz+vb1T9coCTCx5UaX327K8vyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706366842; c=relaxed/simple; bh=FZLyxs2KTnrtcfMD37K8ga7IQTtn1kDf3zqroJHBu0I=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bEgrDhkjpnnGd7qFECr+IiV+mVhIcMUwjMav7nWHh1MLOr1b63V77wvAHqAx4FQwTYUUSr7pOoG3Z3rw8TnmFbl3SzGe/q6phCnetW14WzasR7sIFEqHooeM/20IFcOh2LZfhcfQb1eXoZSs50yJsVvZ8noGDDX44K4MLa5Of4I= 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 8EA99C433C7; Sat, 27 Jan 2024 14:47:20 +0000 (UTC) Date: Sat, 27 Jan 2024 09:47:17 -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: <20240127094717.63c09edb@rorschach.local.home> In-Reply-To: References: <20240126150209.367ff402@gandalf.local.home> <20240126162626.31d90da9@gandalf.local.home> <0C9AF227-60F1-4D9B-9099-1A86502359BA@goodmis.org> X-Mailer: Claws Mail 3.17.8 (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 14:26:08 -0800 Linus Torvalds wrote: > nother thing that worries me is that odd locking that releases the > lock in the middle. I don't understand why you release the > tracefs_mutex() over create_file(), for example. There's a lot of > "take, drop, re-take, re-drop" of that mutex that seems strange. This was because the create_file/dir() would call into the VFS which would grab locks, and on a final dput() on a ei dentry that is to be freed, calls back into eventfs_set_ei_status_free() which also grabs the eventfs_mutex. But it gets called with the same VFS locks that are taken by create_file/dir() VFS calls. This was caught by lockdep. Hence the dropping of those locks. The eventfs_mutex is just protecting the ei list and also assigning and clearing the ei->dentry. Now that dentry is used to synchronize the last close, and also to know if the ei was ever referenced. If ei->dentry is NULL it can be freed immediately (after SRCU) when the directory is deleted. But if ei->dentry is set, it means that something may still have a reference to it and must be freed after the last dput() and SRCU. Now some of this was needed due to the way the dir wrapper worked so I may be able to revisit this and possibly just use an ei->ref counter. But I wasted enough time on this and I'm way behind in my other responsibilities, so this is not something I can work on now. -- Steve