allow the temp files created by open() to be linked to
O_TMPFILE | O_CREAT => linkat() with AT_SYMLINK_FOLLOW and /proc/self/fd/<n> as oldpath (i.e. flink()) will create a link O_TMPFILE | O_CREAT | O_EXCL => ENOENT on attempt to link those guys Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -333,8 +333,10 @@ EXPORT_SYMBOL(set_nlink);
|
||||
*/
|
||||
void inc_nlink(struct inode *inode)
|
||||
{
|
||||
if (WARN_ON(inode->i_nlink == 0))
|
||||
if (unlikely(inode->i_nlink == 0)) {
|
||||
WARN_ON(!(inode->i_state & I_LINKABLE));
|
||||
atomic_long_dec(&inode->i_sb->s_remove_count);
|
||||
}
|
||||
|
||||
inode->__i_nlink++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user