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: 842756 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q6S263RL"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ALa8cp/x"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ynCHG2Bj9z9s83 for ; Thu, 30 Nov 2017 07:46:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ImFaCMuwXAHDS6Quui8pymuSz4IOft8ml0Wys9tHwto=; b=q6S263RL54h9lLiyc0adWBSR4d 3D7LynSiI/WLYTFqQ8XkyuFI+s3nq7Sop/5VapkSI9qOatDIH1Z5GPQm+J4A6vIBVRmAZUXuMPRfk 0cPlAyJWph07z4vskKNBPr5Im6o3jB/PQxz4Ka81odMuDEKOhGexnCZ+dTwBN+rJeUa05PGYq6egw pbVCfg36ls5tkHHpZFOXSNKV16VjrixZRElzwj6WTL1dYvKegaJNbyNxwdzFafVJRV2auvrTYXvfS jA7HXwRHslsNpxDZz/pyaNXFGS5mlDUr8WmWDqDM7RDfxRQzJWiqzFB8MbyBTlyz5k6SitxPT3JrH 1IXZpwdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK9Ew-0005Qx-H7; Wed, 29 Nov 2017 20:45:54 +0000 Received: from mail-it0-x244.google.com ([2607:f8b0:4001:c0b::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK9Dl-0002vJ-IX for linux-mtd@lists.infradead.org; Wed, 29 Nov 2017 20:44:48 +0000 Received: by mail-it0-x244.google.com with SMTP id 68so5770959ite.4 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=OmNdU/r9fcDwFhqEAX50X1a6SVp6FaPz3PJzQF7EnMKyOmK8VkN4RfKhWWX8rTR9Qt Otb1Sy37zrC9dfR7+NURkffhTIvWAAbBPhCcBU4UELwq5LoEwcM1yqGeOXx9pUGeq66z 3ziDutJeD/N1krBsJYnr69Ntc/USSt82JpdLl6+DjYl6wtEv6Y92E0hZvsplBFK5XxZs iCkUL2otskNPMzl9aKrVLX2RXGHOmIlk9akmYuTUAh/1nuSQEuIXncfxrVAHUi4xtrMf WCuxLWNChWmmRAIiuy/HbjN+BeGGRPc16IWLc6w3Wg7F7Tp3q5Ai2DT4D03DEv01Gp3A TICQ== X-Gm-Message-State: AJaThX7HIOFyFMHODu+qu67eiBvVyHLXtvA2e94C2yuKxS2s3MWyzL9R xaI3yGpFD5RFFfQGkeGInpChzYqYOXQ= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_124442_090295_CC2F20D1 X-CRM114-Status: GOOD ( 11.30 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4001:c0b:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fscrypt@vger.kernel.org, Eric Biggers , Adrian Hunter , Artem Bityutskiy MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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)