From: Eric Biggers Date: Wed, 29 Nov 2017 20:35:29 +0000 (-0800) Subject: f2fs: switch to fscrypt_prepare_link() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b05157e772589a5ef315ead84c95c43a7844a2b6;p=openwrt%2Fstaging%2Fblogic.git f2fs: switch to fscrypt_prepare_link() Reviewed-by: Chao Yu Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 28bdf8828e73..dcf5c3a97059 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -240,9 +240,9 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, if (unlikely(f2fs_cp_error(sbi))) return -EIO; - if (f2fs_encrypted_inode(dir) && - !fscrypt_has_permitted_context(dir, inode)) - return -EPERM; + err = fscrypt_prepare_link(old_dentry, dir, dentry); + if (err) + return err; if (is_inode_flag_set(dir, FI_PROJ_INHERIT) && (!projid_eq(F2FS_I(dir)->i_projid,