From patchwork Fri Mar 15 20:54:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10855573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B6181669 for ; Fri, 15 Mar 2019 20:54:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 532C32ABA0 for ; Fri, 15 Mar 2019 20:54:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42A4D2ABA9; Fri, 15 Mar 2019 20:54:59 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E189C2ABA0 for ; Fri, 15 Mar 2019 20:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726868AbfCOUy6 (ORCPT ); Fri, 15 Mar 2019 16:54:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbfCOUy6 (ORCPT ); Fri, 15 Mar 2019 16:54:58 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B27B4218A1; Fri, 15 Mar 2019 20:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552683297; bh=pg1zUG0MG4f6k5icB+Gdlt3BtHXMInEkU6/jrdNyaZQ=; h=From:To:Cc:Subject:Date:From; b=UCjq3nlG2FKQX3RTk7y0BjuVNJRrDKCEwexvoVi2Kiw6Vvn8AlOxmmpQV1QE/tsZ6 2nhu85a44/kXHtFl+9pm72UAfWHtWfAF2WZXrVe2PYVmnZvPfHP2VEjunE2My6677k cswdu4LZPg50Uj6Obc/Rd+n4DKM4Lhs6POJgPmQo= From: Eric Biggers To: linux-mtd@lists.infradead.org Cc: linux-fscrypt@vger.kernel.org Subject: [PATCH] ubifs: remove unnecessary calls to set up directory key Date: Fri, 15 Mar 2019 13:54:32 -0700 Message-Id: <20190315205432.195263-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog MIME-Version: 1.0 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 In ubifs_unlink() and ubifs_rmdir(), remove the call to fscrypt_get_encryption_info() that precedes fscrypt_setup_filename(). This call was unnecessary, because fscrypt_setup_filename() already tries to set up the directory's encryption key. Signed-off-by: Eric Biggers --- fs/ubifs/dir.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 5767b373a8ff..c3311ea68fe5 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -792,12 +792,6 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) dentry, inode->i_ino, inode->i_nlink, dir->i_ino); - if (ubifs_crypt_is_encrypted(dir)) { - err = fscrypt_get_encryption_info(dir); - if (err && err != -ENOKEY) - return err; - } - err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm); if (err) return err; @@ -902,12 +896,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) if (err) return err; - if (ubifs_crypt_is_encrypted(dir)) { - err = fscrypt_get_encryption_info(dir); - if (err && err != -ENOKEY) - return err; - } - err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm); if (err) return err;