From patchwork Wed Nov 29 20:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10083583 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 07C936020B for ; Wed, 29 Nov 2017 20:44:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED19F29C12 for ; Wed, 29 Nov 2017 20:44:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1A6429C13; Wed, 29 Nov 2017 20:44:21 +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 8C14C29C18 for ; Wed, 29 Nov 2017 20:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625AbdK2UoV (ORCPT ); Wed, 29 Nov 2017 15:44:21 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:37846 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361AbdK2UoU (ORCPT ); Wed, 29 Nov 2017 15:44:20 -0500 Received: by mail-it0-f66.google.com with SMTP id d137so5792967itc.2 for ; Wed, 29 Nov 2017 12:44:20 -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=5cfnCRzbkP4tpsxCX5WAyCKbr1VAayPBjecFkzErUcU=; b=ALa8cp/x8XDydyv79B8nXlRdkGV/4VzuWn6+MMy/rtvtWe17/HQX00oGs4rIYATY+S fdfsZl7kbZO+J14Jv9YeZiBVmu8PaOtD781F65mfXHh3FywwRt1IPyhinIedLdJHqZKu MDvJiuj2OJikREL5ie1nTsW2X1q6fvfXTFIwOu2OjekVqzrXOUsHcglSyMIYlJpDoZtr blolILD3RMpDoR7SB/Gjay3COnFIqP6BKOkzXKErKK6QH693KELaUp40GlO6p4cBWnsF K++iYV7rMsSCA3DDAZGc5rSa4p7J43aHVZL+d566wwThDv/xIW1ljVQLKhDEXTC/l4Qz wPjw== 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=5cfnCRzbkP4tpsxCX5WAyCKbr1VAayPBjecFkzErUcU=; b=FJKnGFzJX+xgiPyE8fprngv6TqGJ1B5lf4agiUKkSorJ75tGlELqljIDIGjmPYV1/P uIz/jdWsuvIxUf2bYzwpJI72cPUaS0TNhbHGiwZBQjR97iS/5Uf/dUtmAlvj5wT+RVZM lzwnyizIt9e/hW+/KBwuxulKeI1EuDY7fJ9Wfn6XyTx4XPOEb3teCBDY+QznIufOYdO3 mwioODWD4T3OaNqx7CFdvWWCDsDz0tUElinXSAkuh67nyM6b/FN46evLCOtoHlqmShTc gIi1J+9Cv26yAcOeQR1sWp+mYWiteKNWay9454DrLrw+odktikBNpPR5SM3he1c/TxiC m6Aw== X-Gm-Message-State: AJaThX56R2WzIlREX3Phbj4paDNTeVeBymQlmXOFGyNmys8TjlbpOJpe G8MSdGSdLBhNrWSqXnNKNT0= X-Google-Smtp-Source: AGs4zMbB2/LwdY7TEBB3xd4jqhg2qAzP1fwtP8bFl5+FRh1rq+EKQkaYMg1pc5UjNla5e7yHGeYPQQ== X-Received: by 10.36.40.207 with SMTP id h198mr110152ith.95.1511988260182; Wed, 29 Nov 2017 12:44:20 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id l4sm1111112ioc.69.2017.11.29.12.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 12:44:19 -0800 (PST) From: Eric Biggers To: linux-mtd@lists.infradead.org, Richard Weinberger Cc: linux-fscrypt@vger.kernel.org, Artem Bityutskiy , Adrian Hunter , Eric Biggers Subject: [PATCH v2 4/5] ubifs: switch to fscrypt_prepare_lookup() Date: Wed, 29 Nov 2017 12:43:16 -0800 Message-Id: <20171129204317.91205-5-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129204317.91205-1-ebiggers3@gmail.com> References: <20171129204317.91205-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 Signed-off-by: Eric Biggers --- fs/ubifs/dir.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 7bf847d79b4a..a2ea4856e67b 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -220,20 +220,9 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry, dbg_gen("'%pd' in dir ino %lu", dentry, dir->i_ino); - if (ubifs_crypt_is_encrypted(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 - * 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) - return ERR_PTR(err); - } + err = fscrypt_prepare_lookup(dir, dentry, flags); + if (err) + return ERR_PTR(err); err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm); if (err)