diff mbox series

[01/36] vfs: export new_inode_pseudo

Message ID 20211209153647.58953-2-jlayton@kernel.org
State Superseded
Headers show
Series ceph+fscrypt: context, filename, symlink and size handling support | expand

Commit Message

Jeff Layton Dec. 9, 2021, 3:36 p.m. UTC
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.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/inode.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/fs/inode.c b/fs/inode.c
index 6b80a51129d5..7fd85501bb32 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -951,6 +951,7 @@  struct inode *new_inode_pseudo(struct super_block *sb)
 	}
 	return inode;
 }
+EXPORT_SYMBOL(new_inode_pseudo);
 
 /**
  *	new_inode 	- obtain an inode