[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJx1nkqbQRVCaKgF@slm.duckdns.org>
Date: Wed, 28 Jun 2023 08:02:06 -1000
From: Tejun Heo <tj@...nel.org>
To: Christian Brauner <brauner@...nel.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>, gregkh@...uxfoundation.org,
peterz@...radead.org, lujialin4@...wei.com,
lizefan.x@...edance.com, hannes@...xchg.org, mingo@...hat.com,
ebiggers@...nel.org, oleg@...hat.com, akpm@...ux-foundation.org,
viro@...iv.linux.org.uk, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
linux-fsdevel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/2] kernfs: add kernfs_ops.free operation to free
resources tied to the file
On Wed, Jun 28, 2023 at 07:35:20PM +0200, Christian Brauner wrote:
> > To summarize my understanding of your proposal, you suggest adding new
> > kernfs_ops for the case you marked (1) and change ->release() to do
> > only (2). Please correct me if I misunderstood. Greg, Tejun, WDYT?
>
> Yes. I can't claim to know all the intricate implementation details of
> kernfs ofc but this seems sane to me.
This is going to be massively confusing for vast majority of kernfs users.
The contract kernfs provides is that you can tell kernfs that you want out
and then you can do so synchronously in a finite amount of time (you still
have to wait for in-flight operations to finish but that's under your
control). Adding an operation which outlives that contract as something
usual to use is guaranteed to lead to obscure future crnashes. For a
temporary fix, it's fine as long as it's marked clearly but please don't
make it something seemingly widely useable.
We have a long history of modules causing crashes because of this. The
severing semantics is not there just for fun.
Thanks.
--
tejun
Powered by blists - more mailing lists