From patchwork Thu Mar 14 17:15:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 10853347 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 3767B14DE for ; Thu, 14 Mar 2019 17:23:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15F972A534 for ; Thu, 14 Mar 2019 17:23:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A6DF2A545; Thu, 14 Mar 2019 17:23:30 +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=-7.9 required=2.0 tests=BAYES_00,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 ABE762A534 for ; Thu, 14 Mar 2019 17:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727263AbfCNRXO (ORCPT ); Thu, 14 Mar 2019 13:23:14 -0400 Received: from lilium.sigma-star.at ([109.75.188.150]:53174 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbfCNRXO (ORCPT ); Thu, 14 Mar 2019 13:23:14 -0400 Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 06E4C1802DF6C; Thu, 14 Mar 2019 18:16:18 +0100 (CET) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: linux-fscrypt@vger.kernel.org, jaegeuk@kernel.org, tytso@mit.edu, linux-unionfs@vger.kernel.org, miklos@szeredi.hu, amir73il@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, paullawrence@google.com, Richard Weinberger Subject: [PATCH 3/4] ubifs: Simplify fscrypt_get_encryption_info() error handling Date: Thu, 14 Mar 2019 18:15:58 +0100 Message-Id: <20190314171559.27584-4-richard@nod.at> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314171559.27584-1-richard@nod.at> References: <20190314171559.27584-1-richard@nod.at> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fscrypt_get_encryption_info() does not return -ENOKEY, there is no need to handle this case. Signed-off-by: Richard Weinberger --- fs/ubifs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 5767b373a8ff..b0cb913697c5 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -526,7 +526,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx) if (encrypted) { err = fscrypt_get_encryption_info(dir); - if (err && err != -ENOKEY) + if (err) return err; err = fscrypt_fname_alloc_buffer(dir, UBIFS_MAX_NLEN, &fstr); @@ -794,7 +794,7 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) if (ubifs_crypt_is_encrypted(dir)) { err = fscrypt_get_encryption_info(dir); - if (err && err != -ENOKEY) + if (err) return err; } @@ -904,7 +904,7 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) if (ubifs_crypt_is_encrypted(dir)) { err = fscrypt_get_encryption_info(dir); - if (err && err != -ENOKEY) + if (err) return err; }