Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2796817pxk; Sun, 20 Sep 2020 18:12:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx27I9RcXyd8vPea56LzZnGVXhPdmSo3g60i24BYJ7w2Awk4GVCygnI0UcXdO608E/tMM0i X-Received: by 2002:a17:906:2b48:: with SMTP id b8mr49300562ejg.125.1600650773908; Sun, 20 Sep 2020 18:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600650773; cv=none; d=google.com; s=arc-20160816; b=fbFD//hnvy8LYq/U9MWX/UHctv7ga6V/cA9SI7pWHzyM88RNWeKmM4YOxAT3aVbzzY 6VwxgUzFdJ8V5kc4QBysYAz8l3cdeSziEioe2EdqwWWAdJvmsHjUnrPQSzEQezc32cdJ M+cQ2kHP63IplEUqPbRpKZBzbtB6pwuth7QxzBDdfUrrakLvDNGOPBDgrfOurXeuQmtz 6X2jEq+ZOtE2iZSEzRIAjn5c8ASAR04Dme8Tm5G1/bqAL8A7oarNnYkdg781vVf/MW2C MCoQIywNpnoSeszaZZf1KUFAdxukRecfsFuUHkeanR7FgSGfeDUGHXQGA+hCmXRmv5nd twCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=9hx8NHoxrgAmUHDrDlml2tjQ7eVsFxqE7uamyQPaNuo=; b=kO3StY2ZmIWU140SOo1sr4izl6vPNvfGqMPQIfyNM9TVfLTJAc17Y3wShZYY3pwtol 2swSXCx/JlljA0ExjRewJuqFYG1SdhDaj6QFWBzYtWb4UMuROpBG1Qqv8YGczrXWAYc2 ULP/VrQP1edF5GKkieeTGQdX/rrhlz73WwUJIGv8OGFfbp0bGg8EceKZur8rgBQ25a1F 5lnFhFjLeCiDiwDBpBkFZAW8uRcCo9ckDLaE4L6D208b3vXxki0n5TAiRUG95HrHhizW RuzbfpgtYpNgFteHOytGnyk5jxPDLd/M2rcfveGcosc8DA/ICUADX2J3YjIH5Q4tenvn VTrQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si7450931eji.478.2020.09.20.18.12.24; Sun, 20 Sep 2020 18:12:53 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbgIUBLF (ORCPT + 99 others); Sun, 20 Sep 2020 21:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbgIUBLE (ORCPT ); Sun, 20 Sep 2020 21:11:04 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98606C061755; Sun, 20 Sep 2020 18:11:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id CA5D628BA5A From: Gabriel Krisman Bertazi To: Daniel Rosenberg Cc: "Theodore Ts'o" , linux-ext4@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, Alexander Viro , Andreas Dilger , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@android.com, Eric Biggers Subject: Re: [PATCH v12 4/4] ext4: Use generic casefolding support Organization: Collabora References: <20200708091237.3922153-1-drosen@google.com> <20200708091237.3922153-5-drosen@google.com> Date: Sun, 20 Sep 2020 21:10:57 -0400 In-Reply-To: <20200708091237.3922153-5-drosen@google.com> (Daniel Rosenberg's message of "Wed, 8 Jul 2020 02:12:37 -0700") Message-ID: <87lfh4djdq.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Daniel Rosenberg writes: > This switches ext4 over to the generic support provided in > the previous patch. > > Since casefolded dentries behave the same in ext4 and f2fs, we decrease > the maintenance burden by unifying them, and any optimizations will > immediately apply to both. > > Signed-off-by: Daniel Rosenberg > Reviewed-by: Eric Biggers > > #ifdef CONFIG_UNICODE > - if (EXT4_SB(parent->i_sb)->s_encoding && IS_CASEFOLDED(parent)) { > + if (parent->i_sb->s_encoding && IS_CASEFOLDED(parent)) { > if (fname->cf_name.name) { > struct qstr cf = {.name = fname->cf_name.name, > .len = fname->cf_name.len}; > @@ -2171,9 +2171,6 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry, > struct buffer_head *bh = NULL; > struct ext4_dir_entry_2 *de; > struct super_block *sb; > -#ifdef CONFIG_UNICODE > - struct ext4_sb_info *sbi; > -#endif > struct ext4_filename fname; > int retval; > int dx_fallback=0; > @@ -2190,9 +2187,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry, > return -EINVAL; > > #ifdef CONFIG_UNICODE > - sbi = EXT4_SB(sb); > - if (ext4_has_strict_mode(sbi) && IS_CASEFOLDED(dir) && > - sbi->s_encoding && utf8_validate(sbi->s_encoding, &dentry->d_name)) > + if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) && > + sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name)) > return -EINVAL; hm, just noticed the sb->s_encoding check here is superfluous, since the has_strict_mode() cannot be true if !s_encoding. Not related to this patch though. Daniel, are you still working on getting this upstream? The fscrypt support would be very useful for us. :) In the hope this will get upstream, as its been flying for a while and looks correct. Reviewed-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi