lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Jun 2024 15:13:45 +0200
From: Mateusz Guzik <mjguzik@...il.com>
To: Christian Brauner <brauner@...nel.org>
Cc: Jan Kara <jack@...e.cz>, viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org, linux-btrfs@...r.kernel.org, 
	josef@...icpanda.com, hch@...radead.org
Subject: Re: [PATCH v3 1/2] vfs: add rcu-based find_inode variants for iget ops

On Tue, Jun 11, 2024 at 3:04 PM Christian Brauner <brauner@...nel.org> wrote:
>
> On Tue, Jun 11, 2024 at 01:40:37PM +0200, Mateusz Guzik wrote:
> > On Tue, Jun 11, 2024 at 12:50:11PM +0200, Jan Kara wrote:
> > > On Tue 11-06-24 12:16:31, Mateusz Guzik wrote:
> > > > +/**
> > > > + * ilookup5 - search for an inode in the inode cache
> > >       ^^^ ilookup5_rcu
> > >
> >
> > fixed in my branch
> >
> > > > + * @sb:          super block of file system to search
> > > > + * @hashval:     hash value (usually inode number) to search for
> > > > + * @test:        callback used for comparisons between inodes
> > > > + * @data:        opaque data pointer to pass to @test
> > > > + *
> > > > + * This is equivalent to ilookup5, except the @test callback must
> > > > + * tolerate the inode not being stable, including being mid-teardown.
> > > > + */
> > > ...
> > > > +struct inode *ilookup5_nowait_rcu(struct super_block *sb, unsigned long hashval,
> > > > +         int (*test)(struct inode *, void *), void *data);
> > >
> > > I'd prefer wrapping the above so that it fits into 80 columns.
> > >
> >
> > the last comma is precisely at 80, but i can wrap it if you insist
> >
> > > Otherwise feel free to add:
> > >
> > > Reviewed-by: Jan Kara <jack@...e.cz>
> > >
> >
> > thanks
> >
> > I'm going to wait for more feedback, tweak the commit message to stress
> > that this goes from 2 hash lock acquires to 1, maybe fix some typos and
> > submit a v4.
> >
> > past that if people want something faster they are welcome to implement
> > or carry it over the finish line themselves.
>
> I'm generally fine with this but I would think that we shouldn't add all
> these helpers without any users. I'm not trying to make this a chicken
> and egg problem though. Let's get the blessing from Josef to convert
> btrfs to that *_rcu variant and then we can add that helper. Additional
> helpers can follow as needed? @Jan, thoughts?

That's basically v1 of the patch (modulo other changes like EXPORT_SYMBOL_GPL).

It only has iget5_locked_rcu for btrfs and ilookup5_rcu for bcachefs,
which has since turned out to not use it.

Jan wanted iget5_locked_rcu to follow the iget5_locked in style, hence
I ended up with 3 helpers instead of 1.

I am very much in favor of whacking the extra code and making
iget5_locked_rcu internals look like they did in v1. For reference
that's here:
https://lore.kernel.org/linux-fsdevel/20240606140515.216424-1-mjguzik@gmail.com/

-- 
Mateusz Guzik <mjguzik gmail.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ