Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3696286pxk; Mon, 21 Sep 2020 23:27:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM5K6gJwNU7noXFFGeqGL1BsbBPNydlZt2RApmiYpz9uaXRp2okrAkU+CahQdsujj87ZCX X-Received: by 2002:a17:907:20d0:: with SMTP id qq16mr3043505ejb.65.1600756041734; Mon, 21 Sep 2020 23:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600756041; cv=none; d=google.com; s=arc-20160816; b=usrh11Ald9l9ZGZko74S1+3JtpyfEwu+6L5PS6XiUWxHd20F/DN652BMRJr4fD9WXP 8AN4q9uTa0MJI03kDX60bz7VGF8uOJgKHXLmy4uMZ8Xl1QeipZ7PGV0D5YI2cX2Uhh74 vULAV6Ch9TIW9UaV2JgjltLYbon29D0kZbe6iRs9s7K14vDZhcXPmdv2jgORnFj8eNgA tZ2G1QCanu396aTHjqDVGjEHlTTl9v1EzC90lOtkvdthLrB9aJqz+wGYrD77joGJ914Q TwlUelWKg8k9MrpXDpq1vwg8ucf6prvWLKpU7oC1/QvCOa8bN8kn8/4/qrKYD4AYXpoe hlsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=THG6vXPDgMK2k7M4yyjWTbzR9oGicsRPw9gT2Zgg6Sk=; b=MEO9adB7mM2wHguU35Qve/aqvDcUURz4KQrZjbdw1TJRaytcjLUKPkPHyDBXgAu4fu qr/1VqhdHbjjFUIlcIbNuJa/4EIxO3MJ/CdWuwZJuLJoD5cywMmdi8Czcndl1NW6eHEW te131mDEUzMOs5xknhysA3WZpDB8/LMt+0SPBo48mwExdvgG+3OhbHBtDUwocMBqrkIK 2JdQgdV3qvkNsjK2jvjth/re4p+LUY5K4T2knRhRLrxab5Nvgtlcf23WCbMXi+r/iuWe 58L1uJ5LIFSbVLCCtiIuNwivMeHvVgt79zk0X5bV9O3d6t//eP8OdPHNEO54WUeZz4xZ BMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qd4Tdn1w; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si10076985edu.27.2020.09.21.23.26.47; Mon, 21 Sep 2020 23:27:21 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Qd4Tdn1w; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729230AbgIVGS3 (ORCPT + 99 others); Tue, 22 Sep 2020 02:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729220AbgIVGS3 (ORCPT ); Tue, 22 Sep 2020 02:18:29 -0400 Received: from mail-oo1-xc41.google.com (mail-oo1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9EBAC0613D0 for ; Mon, 21 Sep 2020 23:18:28 -0700 (PDT) Received: by mail-oo1-xc41.google.com with SMTP id h8so3865683ooc.12 for ; Mon, 21 Sep 2020 23:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=THG6vXPDgMK2k7M4yyjWTbzR9oGicsRPw9gT2Zgg6Sk=; b=Qd4Tdn1whmgSMaYeHJVAjI8lu/OUqAsaY6nMEildJ5Wcz+HOxT7jXMUD03tm9yR8G/ vDzyb+d1lGxQNLYIXQnFVhKqaG73yC0TaoNUjzC++ozwpShucs6pqMzhnsZxjr1Nzb4h K1wCeilU3Fa+351ZL8SHv8tnUER/5ayy20tGJ+Jy3mcBP4iSlxPb6pgoN1jPd4Q3Eeam ayKBIA93D2dJaa8PMAJ4fCf08YI7Tow7I09AS1hKl6PGi/YEqKRGKJf0D0x+YgzKHRdo /qbO9M29ylVanv5qWiyLs/g4pHmvhvUZPxJXOAOkBlwa6w0235QHuMaIfR4oJF8EDJME vaJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=THG6vXPDgMK2k7M4yyjWTbzR9oGicsRPw9gT2Zgg6Sk=; b=FVpBxBzSZ4L37Ko9di2yc/3GI3/DuQ2RQ0OsrjcXw2VP5yg/edhaLs2v5ErYvvbDKP KY4b80Q6cADifqc6XyqpFN24lzrjxB8ukpFEXXpPc9p0pFJ7LLCODOvbHHt08q0ywdSA Y7Q5+edVj5hpixwKJ74DHdtvMQinB2ZR1h0Em4qjz4QnSuvOPEjtu7US+FwDe6f0FGzH t1nK/clmSjNtlALQNaMeE4YqxQHf2fhpM/VhWt7/swm5ps+Vfs3mEDAtOPDO7EwXyweM nVRAdTnQggPicy1nbOnABTBj5n+M53Bg2ubkxIlM9s3Z+yRV3AYbU/c+afLdEpjubaqc jHaw== X-Gm-Message-State: AOAM5300UIfaHF5xfSF6DUKZiR9ZgU3XjdYBfcNBH+Bz9hoNrmtZJvmm uz/iP28/5Pyr+Zr82+GEJhe9RCsuWDHPS21WTz7VQw== X-Received: by 2002:a4a:5258:: with SMTP id d85mr1950472oob.72.1600755507994; Mon, 21 Sep 2020 23:18:27 -0700 (PDT) MIME-Version: 1.0 References: <20200708091237.3922153-1-drosen@google.com> <20200708091237.3922153-5-drosen@google.com> <87lfh4djdq.fsf@collabora.com> <20200921182948.GA885472@gmail.com> In-Reply-To: <20200921182948.GA885472@gmail.com> From: Daniel Rosenberg Date: Mon, 21 Sep 2020 23:18:17 -0700 Message-ID: Subject: Re: [PATCH v12 4/4] ext4: Use generic casefolding support To: Eric Biggers Cc: Gabriel Krisman Bertazi , "Theodore Ts'o" , linux-ext4@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Alexander Viro , Andreas Dilger , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Sep 21, 2020 at 11:29 AM Eric Biggers wrote: > > On Sun, Sep 20, 2020 at 09:10:57PM -0400, Gabriel Krisman Bertazi wrote: > > 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 > > We couldn't get a response from Ted, so instead Jaegeuk has applied patches 1-3 > to f2fs/dev for 5.10. Hopefully Ted will take the ext4 patch for 5.11. > > I believe that Daniel is planning to resend the actual encryption+casefolding > support soon, but initially only for f2fs since that will be ready first. > > - Eric Yes, planning to send them shortly. Just checking that I've not missed anything. For the sb_has_strict_encoding, I don't think that's actually checking s_encoding, though it does check s_encoding_flags. I'm planning to resend this one with that set, since it's not queued in the f2fs tree. -Daniel