Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2067377pxu; Tue, 24 Nov 2020 16:26:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuPSUVr/Wa4abRrV0Ol1gMHi4djw/RJ0356cTXZamUwFlhhPSxXmLNutZo78yw5V7Kc42O X-Received: by 2002:a17:906:d0cc:: with SMTP id bq12mr901407ejb.127.1606263982654; Tue, 24 Nov 2020 16:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606263982; cv=none; d=google.com; s=arc-20160816; b=aZkSn1exRwBaH0gGlMGvpbGjZ6sZURp9Jmfw/AX9ChY1Q3mS6sYhiNQXRDD+uZMe1i epviERqjYnPkYEBwSazpGr57q8HFwBrJwU+w7vx0ZojDLaqnKve/x9wgS9XEiCgrWC5M V3FMnEew4VF1iw+0GuwjpPNIOdL0G6jaim7ZwZ1C/GLDJxTLcX4oEAqLvXhAUEhCQE// Axe01rvnUMDxJeV/joHva4CGsuzgzPDwlsPc51mHXnEFVbC5TNy0LwyUQsYsPd6PED/f Iyy2oWZyS4diV/NnsfRV57REcEYoNuhkbgQL5h7BCA747HWVCD2gFUcA2ZIeAIjXnZbw Vxwg== 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=3g7zdwMCiXF/pazFOlaLO4Sn7y2r701x5vWhtKn2IIU=; b=J1AJhzxkHATOYfRuFLtVivIbWRdM8TngFl7S0DuYu6WHOW1KwdPFVfAJNdV5g6hqrQ TmCnFLd9aAR9uh/X7oOmxsVOX3uJSW7HMxD27mWZ38itsHgZPdIrybtanlSaijeAtOBK N/WCF7As8UZJYsPR04PBBxTRX48Cr+GiQ//uoZrGfULzv55+FLXzlVG0CgbIUTCsPhbI MyxiEno0PiDYylQQI5aLewfe04XhhG4wwi9XA4dsKbobvEIuzVSd7L/l1ILBM4+QAGxW +WAKh5wCsC4NeuJBopDOllC/dGLiVpcYlAevcJpkiDj5Td9V/xnttSJd6OTpnODb2Q6s T/3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tNLet1ZG; 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 o91si219980eda.564.2020.11.24.16.25.59; Tue, 24 Nov 2020 16:26:22 -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=tNLet1ZG; 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 S1727352AbgKYAYr (ORCPT + 99 others); Tue, 24 Nov 2020 19:24:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:35420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbgKYAYr (ORCPT ); Tue, 24 Nov 2020 19:24:47 -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 7E01321534; Wed, 25 Nov 2020 00:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606263886; bh=fQf+fnaZQ02pcMEuBF1tBcPKD9HF9tGTFk+IDwiZp4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tNLet1ZGE/CSRBfltP6K7lEGDh8V0fPQXQop96Z8CQDltO+ttQbkZUgKcBixSINvf 268ymGtXK8m+tNIEqeWpmji485xYf22gcpI6X8MVK/vwxmVcLcMHogHu8lwh9N1/O3 dgVXB719889w/ATW8gPyfytv/NMQO/Fv+FNOUBsU= 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 3/9] ubifs: remove ubifs_dir_open() Date: Tue, 24 Nov 2020 16:23:30 -0800 Message-Id: <20201125002336.274045-4-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/ubifs/dir.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 08fde777c324..009fbf844d3e 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1619,14 +1619,6 @@ int ubifs_getattr(const struct path *path, struct kstat *stat, return 0; } -static int ubifs_dir_open(struct inode *dir, struct file *file) -{ - if (IS_ENCRYPTED(dir)) - return fscrypt_get_encryption_info(dir) ? -EACCES : 0; - - return 0; -} - const struct inode_operations ubifs_dir_inode_operations = { .lookup = ubifs_lookup, .create = ubifs_create, @@ -1653,7 +1645,6 @@ const struct file_operations ubifs_dir_operations = { .iterate_shared = ubifs_readdir, .fsync = ubifs_fsync, .unlocked_ioctl = ubifs_ioctl, - .open = ubifs_dir_open, #ifdef CONFIG_COMPAT .compat_ioctl = ubifs_compat_ioctl, #endif -- 2.29.2