Message ID | 20201228185433.61129-4-ebiggers@kernel.org |
---|---|
State | New |
Headers | show |
Series | fscrypt: prevent creating duplicate encrypted filenames | expand |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 63440abe58c42..0ddc4a74b9d43 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2998,6 +2998,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); }