From patchwork Wed Nov 29 20:35:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10083563 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 92D6E6020B for ; Wed, 29 Nov 2017 20:37:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85F7029BD8 for ; Wed, 29 Nov 2017 20:37:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ACEB29BFE; Wed, 29 Nov 2017 20:37:02 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 74EB229BD8 for ; Wed, 29 Nov 2017 20:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbdK2UhA (ORCPT ); Wed, 29 Nov 2017 15:37:00 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:39722 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752767AbdK2Ug4 (ORCPT ); Wed, 29 Nov 2017 15:36:56 -0500 Received: by mail-it0-f66.google.com with SMTP id 68so5744939ite.4 for ; Wed, 29 Nov 2017 12:36:56 -0800 (PST) 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=e9PDYZnzqeYS0/19oVgM7oXa5A7mDTmcnPpKgl1Hgk4=; b=hwVUF1FW0TCR9xA9Ruh/xr7ERsPvEcS6diRX7JPuc13SLg9PfSri2T3TUMje/cmMiY kwnjzA8+KCsS3niMwhe3gR7uCHFGEKonJI9ogJnID7tuMSpQk4xTEYhuv4ahGpVdHdIP Q6SU8M4k9q1bBLpqTNy5nt0AdJD9babopOtPn+dDOOQJnfUZ+i8aXKCu6tmLPN3AAxSY dr8HtQYantAi2xtFt8N0Ybv21l9gOD7qNYMhQl4Imik6XkAsv0BJaoSBjk2L0yircBsM T5gA6NBxQT6wuAodLtmmTaZgrLoBiUvNhtPc9b1xqWPPjHpwyGNbjtRiuXdXgMSd6hKB Vd6w== 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=e9PDYZnzqeYS0/19oVgM7oXa5A7mDTmcnPpKgl1Hgk4=; b=TZmlMbpkehWAOHw7FlkDpXZLmlQx8YkDsmcWzUW5VSA2AyVZfUsOn1b9aw3EAEBzrr zzElvWvGLO0MgYaF0xmQKWNNe8sUUysCSmWuyF4vdpU3xyj7eR7CXYvpv9w9FsAVSOCw G03SnEbvcm4Hhh4t871gLZu4529AMBEHq9kj86oKPtDaQF1NVIDbq+0AWXp2adk5RM+F Uc9FTLhtRCHWpSG6jECxcq5GkY+UuGU9o0cccqdxRllU5SWaOoZOfXybK4kUpu9sJsqj 1sHc1H3194BlLAV4p+T9I8r6m6DygXE/6QDJndxqGusS2lV67kZbdvDanPb9MvQqm/7n CRlA== X-Gm-Message-State: AJaThX76iRFPFU87XW806of45m4rnveI9VkcMR6FmY162zmxsWPmKzpN TCe9pgJVqKczk67TwUG/gRk= X-Google-Smtp-Source: AGs4zMbc9IGahlvIUzLRgmBHt3fa7QWBPbBQl+FqcpsqcWaa2g1rk3abFqIjeKjgiQYYjScwxfKlkw== X-Received: by 10.36.66.209 with SMTP id i200mr120496itb.102.1511987815596; Wed, 29 Nov 2017 12:36:55 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id 15sm1149652ioj.80.2017.11.29.12.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 12:36:55 -0800 (PST) From: Eric Biggers To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim , Chao Yu , linux-fscrypt@vger.kernel.org, Eric Biggers Subject: [PATCH v2 4/5] f2fs: switch to fscrypt_prepare_lookup() Date: Wed, 29 Nov 2017 12:35:31 -0800 Message-Id: <20171129203532.87729-5-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129203532.87729-1-ebiggers3@gmail.com> References: <20171129203532.87729-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Eric Biggers --- fs/f2fs/namei.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index e910d2ebe0c6..bbb3fc1e2bef 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -357,20 +357,9 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, trace_f2fs_lookup_start(dir, dentry, flags); - if (f2fs_encrypted_inode(dir)) { - err = fscrypt_get_encryption_info(dir); - - /* - * DCACHE_ENCRYPTED_WITH_KEY is set if the dentry is - * created while the directory was encrypted and we - * don't have access to the key. - */ - if (fscrypt_has_encryption_key(dir)) - fscrypt_set_encrypted_dentry(dentry); - fscrypt_set_d_op(dentry); - if (err && err != -ENOKEY) - goto out; - } + err = fscrypt_prepare_lookup(dir, dentry, flags); + if (err) + goto out; if (dentry->d_name.len > F2FS_NAME_LEN) { err = -ENAMETOOLONG;