[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251004211908.GD2441659@ZenIV>
Date: Sat, 4 Oct 2025 22:19:08 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Miquel Sabaté Solà <mssola@...ola.com>
Cc: linux-fsdevel@...r.kernel.org, brauner@...nel.org,
linux-kernel@...r.kernel.org, jack@...e.cz
Subject: Re: [PATCH] fs: Use a cleanup attribute in copy_fdtable()
On Sat, Oct 04, 2025 at 11:03:40PM +0200, Miquel Sabaté Solà wrote:
> This is a small cleanup in which by using the __free(kfree) cleanup
> attribute we can avoid three labels to go to, and the code turns to be
> more concise and easier to follow.
Have you tried to build and boot that?
That aside, it is not easier to follow in that form - especially since
kfree() is *not* the right destructor for the object in question.
Having part of destructor done via sodding __cleanup, with the rest
open-coded on various failure exits is confusing as hell.
RAII has its uses, but applied unidiomatically it ends up being a mess
that is harder to follow and reason about than the dreadful gotos it
replaces.
NAKed-by: Al Viro <viro@...iv.linux.org.uk>
Powered by blists - more mailing lists