Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4076967pxb; Tue, 17 Nov 2020 10:36:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhAHJApQwULHe3pbFU2VVyOH0GdVRRi1Ev2VEtEys19d9oIPcyJUkkQJZjTwwg/4xO7Zlg X-Received: by 2002:aa7:d54b:: with SMTP id u11mr22880598edr.341.1605638203428; Tue, 17 Nov 2020 10:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605638203; cv=none; d=google.com; s=arc-20160816; b=sXwAvPPd8snmT2Y1IYujc4BfDhO835TIDW5UUUoG/YYfHn8534Y957MVmRwAHOZ19B zB2WyNgqgPqzfnybEl3aRwhh7DOeoF4IdRI/VkTDMCrrIbBaZx3dRYiRAxZG5w66WRXq miZEojHwXCEP9n9mmCT20UcZaxRuAbYvXTiSQIRBAEaeHOKs1EX8zHNkT9ItxF995Jxy kL/PKnPt+HB/WI5dCOQiMSZWI8CJN1nIwM1aYoiwX9K1fcwcBM++SuChmnCfHyEOdc5S R9Ewhg5IE9V1eSNnFSgBQpMfmkkHyJ/LwJujy9sWBqczO4dqKdcEAQDDbNzexMEiVRDA jPoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lcUYLjyljO8kM5sjjDFbr1tEkwnODfp0P8Tzh4a21/8=; b=b8h6bO85Kbe9xV22haOAb9vBm4flulPv3PgNUh/rzV3wgf0LE7myjqwBPxPV5oGXAF egCHTmx+TkK+0Rks/7SpbMDK6rcRASdSpVibR6WaCkY71cA4G1rG8x1GEe9jJ+dKOAMT 0Io69Pt6gvHGeVY/KIV3lrk6/fhi+EP3nUR8DrH/vjB4ywc52RBvk6s6ZsN9yI7HaRqA XlKObJbcJ//uaE8nFZPrfomdR5WNxLVm1FW173fNDibmeONlvk6s/DfStWtqqJOXoTKC r+R3XmSokqrimKZlC8hotnX8IRo+Vh/wyI+eXN3hJ7t47X4i3K7/lyccF+NMzITtpWid Xdaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TDkYXN8C; 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 pw16si13645942ejb.430.2020.11.17.10.36.18; Tue, 17 Nov 2020 10:36:43 -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=TDkYXN8C; 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 S1727277AbgKQSgJ (ORCPT + 99 others); Tue, 17 Nov 2020 13:36:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:38728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbgKQSgJ (ORCPT ); Tue, 17 Nov 2020 13:36:09 -0500 Received: from sol.localdomain (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA74F223C7; Tue, 17 Nov 2020 18:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605638168; bh=XFTKnyksOQF5hI0TvFTXOnV3KR3hpWlZi6TBqSIlN+o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TDkYXN8CuXva+9OJ9b39gOkV0069pK+fKDahpqGUjsGcqRpFilPNA9fKO0pC028pt IoJRLdqRMCA9DRRLjwr7kUg0oPUfUKs6w/Tw2vuqqcgbZTDTUEyH/IIqd8BM2F1iwh QjPFKNx/xoX0SEq3VPRzU472078pyjJ1hcwl1m/U= Date: Tue, 17 Nov 2020 10:36:06 -0800 From: Eric Biggers To: Daniel Rosenberg Cc: kernel-team@android.com, "Theodore Y . Ts'o" , Richard Weinberger , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Andreas Dilger , Alexander Viro , linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Subject: Re: [f2fs-dev] [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops Message-ID: References: <20201117040315.28548-1-drosen@google.com> <20201117040315.28548-2-drosen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Nov 17, 2020 at 10:16:49AM -0800, Eric Biggers wrote: > > Here's a suggestion which I think explains it a lot better. It's still possible > I'm misunderstanding something, though, so please check it carefully: > > /** > * generic_set_encrypted_ci_d_ops - helper for setting d_ops for given dentry > * @dentry: dentry to set ops on > * > * Casefolded directories need d_hash and d_compare set, so that the dentries > * contained in them are handled case-insensitively. Note that these operations > * are needed on the parent directory rather than on the dentries in it, and the > * casefolding flag can be enabled on an empty directory later but the > * dentry_operations can't be changed later. As a result, if the filesystem has > * casefolding support enabled at all, we have to give all dentries the > * casefolding operations even if their inode doesn't have the casefolding flag > * currently (and thus the casefolding ops would be no-ops for now). > * > * Encryption works differently in that the only dentry operation it needs is > * d_revalidate, which it only needs on dentries that have the no-key name flag. > * The no-key flag can't be set "later", so we don't have to worry about that. > * > * Finally, to maximize compatibility with overlayfs (which isn't compatible > * with certain dentry operations) and to avoid taking an unnecessary > * performance hit, we use custom dentry_operations for each possible > * combination rather always installing all operations. > */ Last line in my suggestion has a typo: "rather" => "rather than". - Eric