Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp373727ybx; Wed, 6 Nov 2019 18:50:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzMYdPD1cTLsVL5emIrfT0Z+1Mrn0OorVCHvZJdm+GADB/cIhdhNN9CvitS7ge5PGcRmEt8 X-Received: by 2002:a17:906:1542:: with SMTP id c2mr878707ejd.80.1573095014154; Wed, 06 Nov 2019 18:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573095014; cv=none; d=google.com; s=arc-20160816; b=OseQW/LXLjM5xkvAlMDAe1o0dWbohMEEyb4rvnjU6vS11EX1lqlXxxK7g6b5D9V8Eg WSqRUDjZqhIksirXqsiGcLOZIMYePSX2UhVhHjMb6d2LXuk6BufUHn+7dV9aaXJy439+ Sil/cBrkjxoiUe6h7/UMArYkwFxIG+XvPUTo7SNXT0gt8CJf1ucAet9ckI/drtPAEmNG vgO+bcfiIAoWisl9gjVjc0s9F1wcuSwAIZWUZQS/y7Y2VTLx6sQj2rkmEVNsH+Z2S569 T6ABeJ+Ebtkj+yGvs1IEQEoQI3zIfEfFDWB5xY7wdUwGmlZYmOwMdyf9kq9vXW1MPA7E 8mNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date; bh=lvOc3mHpCw0OMRDiJ3FGdQqEeZNVl81FbmsoO/XI/Zs=; b=aDNF1Pz5PxprSiW5n4RRlcpbtQF3saHyp6bWWgk2tB/lVdHPFErXsKTYrmLgn7E/zA dwftJYO/SMwyOuGxrGU+IcJiFvIIPzfYdmQV4Y/dgnUL+4ODayuB404N1uzkBBvTwQPk rrXEHUeNUA291P+wBCq+JXKeYMT4KOlz+R59y1ycvqmQnRbicyO1BJnAu2fQcwPI0kJm wzplj1SHKZXb9lz7AYkEoEJnR3slZpV97/II2FMbhH6lsM62g0tnvOiw17jWUEg4ohmE XbKTD8a8moedrRXwCbBzzWzI3ge+aKdZtcZeWRlJ0cusuIAhBFd9f6Mn+/NceGCwVcKf g2vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19si338154ejv.94.2019.11.06.18.49.40; Wed, 06 Nov 2019 18:50:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727665AbfKGCtj (ORCPT + 99 others); Wed, 6 Nov 2019 21:49:39 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:56989 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727443AbfKGCtj (ORCPT ); Wed, 6 Nov 2019 21:49:39 -0500 Received: from callcc.thunk.org (ip-12-2-52-196.nyc.us.northamericancoax.com [196.52.2.12]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id xA72nLni011638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Nov 2019 21:49:22 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 799C4420311; Wed, 6 Nov 2019 21:49:19 -0500 (EST) Date: Wed, 6 Nov 2019 21:49:19 -0500 From: "Theodore Y. Ts'o" To: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Satya Tangirala , Paul Crowley , Paul Lawrence , Jaegeuk Kim Subject: Re: [PATCH v2 1/3] fscrypt: add support for IV_INO_LBLK_64 policies Message-ID: <20191107024919.GH26959@mit.edu> References: <20191024215438.138489-1-ebiggers@kernel.org> <20191024215438.138489-2-ebiggers@kernel.org> <20191106033544.GG26959@mit.edu> <20191106040519.GA705@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191106040519.GA705@sol.localdomain> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Nov 05, 2019 at 08:05:19PM -0800, Eric Biggers wrote: > If we really wanted to optimize fscrypt_get_encryption_info(), I think we > probably shouldn't try to microoptimize fscrypt_supported_policy(), but rather > take advantage of the fact that fscrypt_has_permitted_context() already ran. > E.g., we could cache the xattr, or skip both the keyring lookup and > fscrypt_supported_policy() by grabbing them from the parent directory. Yes, good point. Certainly, if the parent is encrypted, given that we force files to have the same policy as the containing directory, there's no point calling fscrypt_supported_policy. And if we're using a policy which isn't using per-inode keys, then we can certainly just grab the key from the parent directory. - Ted