Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2066902pxu; Tue, 24 Nov 2020 16:25:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGEQUvGZLpgeH26tjqKdXVc613Vap2GAG7/Gb1xUD4cyRR2DprTf2uEhcwPO2yp3kZWw81 X-Received: by 2002:a17:906:e24d:: with SMTP id gq13mr905208ejb.262.1606263919456; Tue, 24 Nov 2020 16:25:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606263919; cv=none; d=google.com; s=arc-20160816; b=Ho05g94W7zoxnMBlwsxWhDBXG1LFtnaCQ0NmFteFSx3Bhgzp5DrDUisxae8uXYig4u MhsOvqxaCjGW9MUtqsw5POrVurt1ymRTYT0uY9LNC+Z+R19abD4gniCYF3KVoIGuft+L rN9YY2DDpnKePaM/i0+EoMBnFEKSTE8ITQl6JvW2cGRbm+lwkLaZ/bDAzs8if16LU0En M3mhDjwwI67zlgw5ZDVmlurERh5fw9BcVoJcUHAr6Aou5Wp0LjRPpluByTnwLrutrbwA L1lbnfAwZXxeTQX23zzlALWtMSG+MQ7K9uQju3+od/WBzhShTmZ7C75zqpe7XWTaxt82 h4Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NHhtqp3KgmqMWi3g0c0lrx8o2uYcVzshjaPStLB63A4=; b=n/4r2ha/aXpXKjuvNpU+pPZDAtAC8ulMkpzjh7x4p1TH0aqnZlvZus0Ib+008r1/wY Z4vXwBq6q9T6qhCRNxUU969ng9mswuY1mFyInP24kZ0ktVjoTwGO9djMPy1ecQcYQb0R E1hmEk6qo9ae75FVC/b7wcrk/KhGEJHHWRV8s45E2wfCLnsSv5GKS09O3tkj+RJl1QWy sldemM6VHILn+VX+p2AAETueJVA7AZ1PgGVslaSWoCYT8Ips8giOXqvHBsUYHeJO+X99 8ShowYqQGddIdd9qDDu8RhYt04isG3yPFtG28tc2oeaFcTjwtFAsehnLAHmxTVBUf80d BfYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AJl8OkUG; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si196194edt.600.2020.11.24.16.24.50; Tue, 24 Nov 2020 16:25:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AJl8OkUG; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbgKYAYr (ORCPT + 99 others); Tue, 24 Nov 2020 19:24:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:35406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbgKYAYq (ORCPT ); Tue, 24 Nov 2020 19:24:46 -0500 Received: from sol.attlocal.net (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (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 F2DB02151B; Wed, 25 Nov 2020 00:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606263886; bh=rnYdUr37PtuJdOHsrO7sMu2HuLBhc/5UVpsjNmKp6y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AJl8OkUGDWFwxrxlZqEpgv4PwMCU1rjl5L7p1rg/lZNBS90ofHleDkHoORna07IZH L4PwZP6J+7e4F/HrUuXir6oThE5TGXcT0nQplwrbj/sZESB+7UVh4fPV9Lswxl7DZb 3Gx3DfYhqSUtcl/Z9Qd87ORSV1pWNXLhGd1ryKoM= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/9] ext4: remove ext4_dir_open() Date: Tue, 24 Nov 2020 16:23:28 -0800 Message-Id: <20201125002336.274045-2-ebiggers@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125002336.274045-1-ebiggers@kernel.org> References: <20201125002336.274045-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers Since encrypted directories can be opened without their encryption key being available, and each readdir tries to set up the key, trying to set up the key in ->open() too isn't really useful. Just remove it so that directories don't need an ->open() method anymore, and so that we eliminate a use of fscrypt_get_encryption_info() (which I'd like to stop exporting to filesystems). Signed-off-by: Eric Biggers --- fs/ext4/dir.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index ca50c90adc4c..16bfbdd5007c 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -616,13 +616,6 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) return 0; } -static int ext4_dir_open(struct inode * inode, struct file * filp) -{ - if (IS_ENCRYPTED(inode)) - return fscrypt_get_encryption_info(inode) ? -EACCES : 0; - return 0; -} - static int ext4_release_dir(struct inode *inode, struct file *filp) { if (filp->private_data) @@ -664,7 +657,6 @@ const struct file_operations ext4_dir_operations = { .compat_ioctl = ext4_compat_ioctl, #endif .fsync = ext4_sync_file, - .open = ext4_dir_open, .release = ext4_release_dir, }; -- 2.29.2