From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: [PATCH v2 2/5] f2fs: switch to fscrypt_prepare_link() Date: Wed, 29 Nov 2017 12:35:29 -0800 Message-ID: <20171129203532.87729-3-ebiggers3@gmail.com> References: <20171129203532.87729-1-ebiggers3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eK96J-0004Fs-Bs for linux-f2fs-devel@lists.sourceforge.net; Wed, 29 Nov 2017 20:36:59 +0000 Received: from mail-it0-f68.google.com ([209.85.214.68]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1eK96I-0006nV-Hg for linux-f2fs-devel@lists.sourceforge.net; Wed, 29 Nov 2017 20:36:59 +0000 Received: by mail-it0-f68.google.com with SMTP id t1so5594613ite.5 for ; Wed, 29 Nov 2017 12:36:58 -0800 (PST) In-Reply-To: <20171129203532.87729-1-ebiggers3@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim , linux-fscrypt@vger.kernel.org, Eric Biggers From: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Eric Biggers --- fs/f2fs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, -- 2.15.0.531.g2ccb3012c9-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot