From patchwork Wed Sep 20 22:46:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9962775 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 93F8160208 for ; Wed, 20 Sep 2017 22:47:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8156629267 for ; Wed, 20 Sep 2017 22:47:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7649629158; Wed, 20 Sep 2017 22:47:45 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 1D12329279 for ; Wed, 20 Sep 2017 22:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbdITWrW (ORCPT ); Wed, 20 Sep 2017 18:47:22 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37619 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbdITWrS (ORCPT ); Wed, 20 Sep 2017 18:47:18 -0400 Received: by mail-pf0-f194.google.com with SMTP id e69so1716599pfg.4; Wed, 20 Sep 2017 15:47:17 -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=doywBDCY0Q86VZC6d+ZGKrHg7RVLKcPpcs6GqWDIrmE=; b=I9iv+aSbRnSB3KdNsisa7YE6rsTLg9O2jiqhDU9ZHcbmeYLNCU9zKwoiFNQgLSc2m3 PU1dLoyOBGGfL8O9J0UDmuWvr8GbzdN6jFxgR+zZKV9UDRAs2GPr29U6hbmPhdVYK4c9 6u1Jhdk7nNPzhCZdmJIJHoHbsGLK3WaCj6HM05RfzvQm9BB6OaIyC1THIBr8W+hKGvqf Qnj1qlhk/04lYpd0lhxkZ190JC2AJn17R42tOqIq77bbA+WVOpuVlYcqX7lg1ln0vYLn fLjZoYMkcsicNpQyiIfTFgyRoAreE8yWs4kXbN2S+WpAwXqtiuaO3vNtitZ2RtQtrl/V aq+g== 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=doywBDCY0Q86VZC6d+ZGKrHg7RVLKcPpcs6GqWDIrmE=; b=YY8xD00AR6wphoC/10qAGnh1ij+PhIKTmkDdOIj+0EzhjWKD4sjMLy8rf7i5VJrucE VGWcSnxruV9IyTbkzVX0rhUv/Xc3H+TrtuK1zLYe8kgIoen6ILQcpYnZDMAIkfOz66lb 4LBF7/kB0qdyQgtBmuifV0Uri4ZTkRgcHOE2hVoqhJnlZlOnSJbl5ri2reSovAIkfzfV qb+rLlBuRyMNcJNfXiYB3n8jmXn6t/tIw0qGxUuNWOzxhrEbDWyv4JFfX/3DKPy6seE4 5t23pi811L4v6xlotd5XkBbg/nVINIAXo1GEngJjPT7F32oB4l2cX1+5sd8xynuubAZZ gaGg== X-Gm-Message-State: AHPjjUjAA4nuY6dgxr/ssSTadcA+dmGRpPFJW4qn0WFa7m2QVcXEd3Jn X27iR31nUWuyrS5yoid01MknmB57x0A= X-Google-Smtp-Source: AOwi7QCk3DgxO56V+1yhmSHJSNLy5Sgo/Xo9MNVr41WCKhY8WHCDCudNrmPYpYNO/FULhI/11scMOg== X-Received: by 10.84.238.143 with SMTP id v15mr3611995plk.303.1505947637247; Wed, 20 Sep 2017 15:47:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:47:16 -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 24/25] ubifs: switch to fscrypt_prepare_lookup() Date: Wed, 20 Sep 2017 15:46:04 -0700 Message-Id: <20170920224605.22030-25-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-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)