From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5120EC432C0 for ; Tue, 3 Dec 2019 19:52:25 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 184D3207DD for ; Tue, 3 Dec 2019 19:52:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="JwEc4NbT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="I61X0zxQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 184D3207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1icEDg-0004iG-IU; Tue, 03 Dec 2019 19:52:24 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1icEDe-0004i1-VX for linux-f2fs-devel@lists.sourceforge.net; Tue, 03 Dec 2019 19:52:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0PvaWL5bp3OyayqEteEnymHXOfnE6BIv5XBY99d3q/8=; b=JwEc4NbTrFecjJ2NZGGF9MD7lV rOSnV7WD34a5PShuL482VVsYmKdm1wEH1p/+PI0wuvyZkdnE2eO3YXcdKXHXtZHuKma2l6KBZwsXN YYfhpF2HtPQ4FMEF1iY2F5vPSPt4X41vhKQCiZy3uLSoQZRlPWtFahxxQYKGgX/GFQLQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject: Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0PvaWL5bp3OyayqEteEnymHXOfnE6BIv5XBY99d3q/8=; b=I61X0zxQwbIccNoetwoPRRt4Ek gxW8pZIrxyQfxzArG8kFgFK+3XrLGzd2AIz0uaim4bUHWr1RND3lwqCuhdilPfCWe7zwlqZteH81/ Cv+SBiBA9U91k05pPtc9LXIPPdazS2+pYO9s80rRELK9cfBl/bYXKAOnJ8a/jnI3UMwk=; Received: from bhuna.collabora.co.uk ([46.235.227.227]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1icEDc-002qnr-V5 for linux-f2fs-devel@lists.sourceforge.net; Tue, 03 Dec 2019 19:52:22 +0000 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 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 X-Headers-End: 1icEDc-002qnr-V5 Subject: Re: [f2fs-dev] [PATCH 4/8] vfs: Fold casefolding into vfs X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Theodore Ts'o , Daniel Rosenberg , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, Andreas Dilger , Alexander Viro , linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel