[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030014818.GG1350452@ZenIV>
Date: Wed, 30 Oct 2024 01:48:18 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Song Liu <song@...nel.org>
Cc: bpf@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com,
andrii@...nel.org, eddyz87@...il.com, ast@...nel.org,
daniel@...earbox.net, martin.lau@...ux.dev, brauner@...nel.org,
jack@...e.cz, kpsingh@...nel.org, mattbobrowski@...gle.com,
amir73il@...il.com, repnop@...gle.com, jlayton@...nel.org,
josef@...icpanda.com
Subject: Re: [RFC bpf-next fanotify 2/5] samples/fanotify: Add a sample
fanotify fastpath handler
On Wed, Oct 30, 2024 at 12:11:55AM +0000, Al Viro wrote:
> On Tue, Oct 29, 2024 at 04:12:41PM -0700, Song Liu wrote:
> > + if (strstr(file_name->name, item->prefix) == (char *)file_name->name)
>
> Huh? "Find the first substring (if any) equal to item->prefix and
> then check if that happens to be in the very beginning"???
>
> And you are placing that into the place where it's most likely to cause
> the maximal braindamage and spread all over the tree. Wonderful ;-/
>
> Where does that "idiom" come from, anyway? Java? Not the first time
> I see that kind of garbage; typecast is an unusual twist, though...
After some coproarchaeology: it's probably even worse than java - in
javashit indexOf() predates startsWith() by quite a few years; java itself
had both methods from the very beginning. So that's probably where it had
been cargo-culted from...
The thing is, performance requirements of some garbage script from
a javascript-infested webshite are somewhat different from what you want
to see anywhere near the kernel-side filesystem event handling...
Powered by blists - more mailing lists