Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

convert securityfs

securityfs uses simple_recursive_removal(), but does not bother to mark
dentries persistent. This is the only place where it still happens; get
rid of that irregularity.

* use simple_{start,done}_creating() and d_make_persitent(); kill_litter_super()
use was already gone, since we empty the filesystem instance before it gets
shut down.

Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 2026c6f8 fc45aee6

+12 -21
+12 -21
security/inode.c
··· 127 127 parent = mount->mnt_root; 128 128 } 129 129 130 + inode = new_inode(parent->d_sb); 131 + if (unlikely(!inode)) { 132 + dentry = ERR_PTR(-ENOMEM); 133 + goto out; 134 + } 135 + 130 136 dir = d_inode(parent); 131 137 132 - inode_lock(dir); 133 - dentry = lookup_noperm(&QSTR(name), parent); 134 - if (IS_ERR(dentry)) 138 + dentry = simple_start_creating(parent, name); 139 + if (IS_ERR(dentry)) { 140 + iput(inode); 135 141 goto out; 136 - 137 - if (d_really_is_positive(dentry)) { 138 - error = -EEXIST; 139 - goto out1; 140 142 } 141 - 142 - inode = new_inode(dir->i_sb); 143 - if (!inode) { 144 - error = -ENOMEM; 145 - goto out1; 146 - } 147 - 148 143 inode->i_ino = get_next_ino(); 149 144 inode->i_mode = mode; 150 145 simple_inode_init_ts(inode); ··· 155 160 } else { 156 161 inode->i_fop = fops; 157 162 } 158 - d_instantiate(dentry, inode); 159 - inode_unlock(dir); 160 - return dentry; 163 + d_make_persistent(dentry, inode); 164 + simple_done_creating(dentry); 165 + return dentry; // borrowed 161 166 162 - out1: 163 - dput(dentry); 164 - dentry = ERR_PTR(error); 165 167 out: 166 - inode_unlock(dir); 167 168 if (pinned) 168 169 simple_release_fs(&mount, &mount_count); 169 170 return dentry;