From patchwork Wed Sep 20 22:45:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9962799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CDEE160208 for ; Wed, 20 Sep 2017 22:47:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C076E28925 for ; Wed, 20 Sep 2017 22:47:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4F5828A28; Wed, 20 Sep 2017 22:47:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C56229273 for ; Wed, 20 Sep 2017 22:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752011AbdITWrP (ORCPT ); Wed, 20 Sep 2017 18:47:15 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33209 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbdITWrK (ORCPT ); Wed, 20 Sep 2017 18:47:10 -0400 Received: by mail-pf0-f195.google.com with SMTP id h4so1728642pfk.0; Wed, 20 Sep 2017 15:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ywnmT6n59+Xpv6fhlcK7gzredb959P8opuLuaqGP3qQ=; b=LLS4T3XHf8LZZeynHewIsS1jboFW+vz9Xtvdpy6Vo7bBAcIqFACzzQrnXzCSP6JJFt 5ffeuzclPq2Qm57YyBpR8rAN2UK5I3TZRscq51KFPcKn038oMfLr5J6jSRJzK2teQ1Hd mTrOBywA7AwcKLIG9qhXqNhZjbANiPZdNwijK2smP11vvy461lQFI2WeyQI0CfomuQ6E MM/VgtRv13Zgcx89yuxT5b/KzIIpET/m2sYKe3KAbQfCsB3vd+5R0a2I7RseR8swWoGj ccVLJrE+mF0gyYKidpynChYM/gqxKbGoLp+In9ueEMafwbO7F2jMIkA6vlDKg1jHpwtW 0kPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ywnmT6n59+Xpv6fhlcK7gzredb959P8opuLuaqGP3qQ=; b=UIBwyiVqrZNukFg+4PM3NtjbqiRkEn8Kb5tLiaEo28vVjQXIPlDDZJPSzJWj6XGLFg oJgeQofBKPmX4tSzQ+z6k8hi2C7JDOjw+4kmvWTtZTEbQuKEiZLUlrmFF04w60PKp4xv Gv6OLDT8Po2JSPiAQa9LlenrnZGcDKuLuyN2FESSrv5HQYse+LBLqI02HfiDG+bnMcGC Ahv/uFLIs2QV1UvTMrBVbx6HlRy6YsSdJ1HEpAM4Thz9cTERjIC7CALN8e9cdFLUC9bU SshJlvQ/uDYAKMPlLe8RAjggqljQbZN66tu5F9m2oAhlBr0ND0+zZF53lPZFxUJwa3Oq ILag== X-Gm-Message-State: AHPjjUhlRPPuK3qwmww94/ff52HjzB/z1pjbrsEJeR8jXFpBsBe54QO4 VSoQ4CnoPSxgLh510SmdzlyF5bsQdzQ= X-Google-Smtp-Source: AOwi7QD0QLa93r73SuYjXSLfkQ53JO+50SYfOcr/UYab2Td9qVEpjpTUkhjUPR5v17trh2oTtIa5qg== X-Received: by 10.84.129.71 with SMTP id 65mr3492806plb.250.1505947629592; Wed, 20 Sep 2017 15:47:09 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id j2sm6249pgn.26.2017.09.20.15.47.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:09 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, "Theodore Y . Ts'o" , Jaegeuk Kim , Michael Halcrow , Eric Biggers Subject: [PATCH 17/25] f2fs: switch to fscrypt_prepare_link() Date: Wed, 20 Sep 2017 15:45:57 -0700 Message-Id: <20170920224605.22030-18-ebiggers3@gmail.com> X-Mailer: git-send-email 2.14.1.821.g8fa685d3b7-goog In-Reply-To: <20170920224605.22030-1-ebiggers3@gmail.com> References: <20170920224605.22030-1-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers 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 a4dab98c4b7b..cf4e4294e450 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -221,9 +221,9 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, struct f2fs_sb_info *sbi = F2FS_I_SB(dir); int err; - 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,