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:   Thu, 31 Mar 2022 18:23:59 -0400
From:   Jeff Layton <jlayton@...nel.org>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     ceph-devel@...r.kernel.org, xiubli@...hat.com, idryomov@...il.com,
        lhenriques@...e.de, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 01/54] vfs: export new_inode_pseudo

On Thu, 2022-03-31 at 19:50 +0000, Al Viro wrote:
> On Thu, Mar 31, 2022 at 11:30:37AM -0400, Jeff Layton wrote:
> > Ceph needs to be able to allocate inodes ahead of a create that might
> > involve a fscrypt-encrypted inode. new_inode() almost fits the bill,
> > but it puts the inode on the sb->s_inodes list and when we go to hash
> > it, that might be done again.
> > 
> > We could work around that by setting I_CREATING on the new inode, but
> > that causes ilookup5 to return -ESTALE if something tries to find it
> > before I_NEW is cleared. This is desirable behavior for most
> > filesystems, but doesn't work for ceph.
> > 
> > To work around all of this, just use new_inode_pseudo which doesn't add
> > it to the sb->s_inodes list.
> 
> Umm...  I can live with that, but... why not just leave the hash insertion
> until the thing is fully set up and you are ready to clear I_NEW?

If the thing is already in the hash at the end then we have to go back
and redo the inode update with the correct inode. That can be messy too
-- in some cases we hand off strings and such.

On IRC, Al suggested that we instead change the test in inode_insert5 so
we can avoid the double list_add. I'm testing a patch now that seems to
be working, so I'll plan to drop this one in favor of that approach.

Thanks for the help!
-- 
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ