Message ID | 20201228191211.138300-4-ebiggers@kernel.org |
---|---|
State | Superseded |
Headers | show |
Series | fscrypt: prevent creating duplicate encrypted filenames | expand |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 53ffa6fe207a3..aacd8e11758ca 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2857,6 +2857,8 @@ bool f2fs_empty_dir(struct inode *dir); static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode) { + if (fscrypt_is_nokey_name(dentry)) + return -ENOKEY; return f2fs_do_add_link(d_inode(dentry->d_parent), &dentry->d_name, inode, inode->i_ino, inode->i_mode); }