Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1729784ybl; Tue, 3 Dec 2019 11:43:44 -0800 (PST) X-Google-Smtp-Source: APXvYqw1hg8puNC/VAz+psCET7+15XwW5cYkrWJmS+HkzbCg1jXerMzBmvUqPhUx3ddt7xwXBpkr X-Received: by 2002:a05:6808:3bc:: with SMTP id n28mr4942859oie.112.1575402223986; Tue, 03 Dec 2019 11:43:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575402223; cv=none; d=google.com; s=arc-20160816; b=BNDe1MCy2YpxPaNVSrz6gxpUG8SCL07MLIDFlrc4iY8FUEllNmh9H0Nqf3vc+HUuWt JJgowZbHnh89KGXYhTfXlZp6sZDyZ7uTYmPqtBOWqVIwdp4AxQ9uPKqrZrS6X61W1i6c hrsfJyX+iJrvSFZMrSfVO4VAO72pQ/rVVk0q0e/hV8RsWa6rKvuNeWJYXI5OPzG48R2D joULI+juDcFi6D1Zx4yB5NBaK1ECdONisQ6IG+tCfbDrT36rO6H0SCr7RzcdNB4JL8pK Vrw0HCkLMwObyCcdi5C+SEaniHnPEsWk29dzNlOlp3pTaopnue1aoG3J6hjrqUSS/vwB 1/DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=0PvaWL5bp3OyayqEteEnymHXOfnE6BIv5XBY99d3q/8=; b=N8hbQAI+6XGAlJGx0aVZ2+VbFfehPCmTUtcMMYUberr+tPJAmb8qUmHPjGeDrexlFv aJXGEF862U0wRIxuGzYF2QJogTKqRbwBw9ywBIPjrIFVAzqjq4UPjNZy/6xVs8cLy1Hd wzUkjj1D8pTRbGEIRKKuSnTo0BaWjaq8MRJm45+mT98Xr8XiWlYPq4o1XR80O//yZevh bZ4T79DRN/7OYJQYESptQvwtIws9zm/U4dWyhs7f1jpjPDIS/ZMAmu5VfJLfBIjjrQ7h L9pSx8NLfABR5bc0XXRbXCW8uDmH0xyo6vvq6uke2VIgXNmdWrNIUW9gWwrtOzNr9J/f 3G0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si476745oic.216.2019.12.03.11.43.32; Tue, 03 Dec 2019 11:43:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbfLCTmQ (ORCPT + 99 others); Tue, 3 Dec 2019 14:42:16 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:36132 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbfLCTmQ (ORCPT ); Tue, 3 Dec 2019 14:42:16 -0500 Received: from localhost (unknown [IPv6:2610:98:8005::647]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6C9562909E7; Tue, 3 Dec 2019 19:42:14 +0000 (GMT) From: Gabriel Krisman Bertazi To: Gao Xiang Cc: Daniel Rosenberg , Theodore Ts'o , , Jaegeuk Kim , Chao Yu , , Eric Biggers , , Alexander Viro , Andreas Dilger , Jonathan Corbet , , , , Subject: Re: [PATCH 4/8] vfs: Fold casefolding into vfs Organization: Collabora References: <20191203051049.44573-1-drosen@google.com> <20191203051049.44573-5-drosen@google.com> <20191203074154.GA216261@architecture4> Date: Tue, 03 Dec 2019 14:42:10 -0500 In-Reply-To: <20191203074154.GA216261@architecture4> (Gao Xiang's message of "Tue, 3 Dec 2019 15:41:54 +0800") Message-ID: <85wobdb3hp.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gao Xiang writes: > On Mon, Dec 02, 2019 at 09:10:45PM -0800, Daniel Rosenberg wrote: >> Ext4 and F2fs are both using casefolding, and they, along with any other >> filesystem that adds the feature, will be using identical dentry_ops. >> Additionally, those dentry ops interfere with the dentry_ops required >> for fscrypt once we add support for casefolding and encryption. >> Moving this into the vfs removes code duplication as well as the >> complication with encryption. >> >> Currently this is pretty close to just moving the existing f2fs/ext4 >> code up a level into the vfs, although there is a lot of room for >> improvement now. >> >> Signed-off-by: Daniel Rosenberg > > I'm afraid that such vfs modification is unneeded. > > Just a quick glance it seems just can be replaced by introducing some > .d_cmp, .d_hash helpers (or with little modification) and most non-Android > emulated storage files are not casefolded (even in Android). > > "those dentry ops interfere with the dentry_ops required for fscrypt", > I don't think it's a real diffculty and it could be done with some > better approach instead. It would be good to avoid dentry_ops in general for these cases. It doesn't just interfere with fscrypt, but also overlayfs and others. The difficulty is that it is not trivial to change dentry_ops after dentries are already installed in the dcache. Which means that it is hard to use different dentry_ops for different parts of the filesystem, for instance when converting a directory to case-insensitive or back to case-sensitive. In fact, currently and for case-insensitive at least, we install generic hooks for the entire case-insensitive filesystem and use it even for !IS_CASEFOLDED() directories. This breaks overlayfs even if we don't have a single IS_CASEFOLDED() directory at all, just by having the superblock flag, we *must* set the dentry_ops, which already breaks overlayfs. I think Daniel's approach of moving this into VFS is the simplest way to actually solve the issue, instead of extending and duplicating a lot of functionality into filesystem hooks to support the possible mixes of case-insensitive, overlayfs and fscrypt. -- Gabriel Krisman Bertazi