Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1986721iob; Thu, 19 May 2022 21:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBr3DMnQhVgtbH4tgSpJK6euWEDPs36MsYdcv29RAUfLHjcGL29v36aKCTJvkCz2LE/vqK X-Received: by 2002:aa7:cd87:0:b0:427:f800:220d with SMTP id x7-20020aa7cd87000000b00427f800220dmr9048567edv.112.1653022159821; Thu, 19 May 2022 21:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653022159; cv=none; d=google.com; s=arc-20160816; b=qJEhI7CAAFXSa5ZghUdBu3CwDfDT+JnUPyfvmnX+S3qf3JjE+cOBrEi0QVONfhd1Oi C6JFPrVf235O9ilH2j2lz6yeDnietHUehrc2Cdh/meNdB/el8J8C2EYhyhvU6OukH0f/ wlnRaTYHzYHyhxlT4yEybr/CZ5pBIdq+P9Th6rtSsCUo1Bc8pbyOfgtBC4KC4VB0S3y6 stsldr0rvKYofYoCC3uF3U6uN0XMQrIDbKQRzz01ValdfkLyu45NiPOslehhG7UupAIB +PtJsJVMQd8ER5cRvvKn1Y9IgeMe+SwyKQWaF8pwihr5c5pebXXIzTdQ1mKG5MXUEUnB RKuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZrTv3QvLLHyK75XRTH4iFVs4p7lsGGVaLxI2nvRmAAM=; b=L9qOBp0TqErn/upwGfjpjOTHl8eYVhFii2IxIC8X4a0ey4B57VuEWtewKhCKyYbq6A Z6IazDVLzyWbkLHRHRrBhuJ+w289C4JhgCS2+uBI/UGn49fHK40avVkrvAOa1sp0vh5Z muqjPlJBBgRPBFz1qFzGJPhF1Ed5hTK30iWHYdxls2Cz+2qSn8g5sQjjcnPtpZd7LnSo tyjg5pyWzSpY4DfAMkbpC1hhmGv1XJIJIcULi62ls61tTZ0P791sz2zf3W70FIz8Im73 hsRQ9Sq2IjW4eoohACL93j+lgum67Hfws1iWRdPaipEyqWvUI70wIgS4tRPer45RTqor HReg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UoO9k3wg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020aa7c2d1000000b004262cf3f74asi6553932edp.599.2022.05.19.21.48.48; Thu, 19 May 2022 21:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UoO9k3wg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244787AbiESUqz (ORCPT + 99 others); Thu, 19 May 2022 16:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244779AbiESUqx (ORCPT ); Thu, 19 May 2022 16:46:53 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1318D326C2 for ; Thu, 19 May 2022 13:46:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 440B21F4541F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652993210; bh=xCVBbVqmp/7jdLxAOUghr2fFaWRVCwCpo6pL22/iD0s=; h=From:To:Cc:Subject:Date:From; b=UoO9k3wgi5Fb1gCN8TDV9Y8pAjTMFrwN/ggG3eCpupEqmuu1nhgaazd7SlK4v9Yxf 3X672PGuzPHSNRKQG80EZGNHo3+3/QLUQ5ne/3cM8lci9t2hUare9LMHrU6d4srmF4 gW5Te36VGs/qs7xFWxaFGk12T9FykEBkvGHEQEY496MMvXc+cBvQuDeyAg4nHm1Qyo /AB9GbAbUzHycbuk9bAA96q3PywwDJJQmhG+fIE/oIJHcxxRVQdy5rz9DqRVTl1gt5 zgj9MDTyEE5ZlJKZ41Nd5m4wjhwdJYHe9M4ufd8K9HQVsmrRMOU6Annf/7MdrjO8yU /CZxYAyiJDaHg== From: Gabriel Krisman Bertazi To: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, ebiggers@kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v7 0/8] Clean up the case-insensitive lookup path Date: Thu, 19 May 2022 16:46:37 -0400 Message-Id: <20220519204645.16528-1-krisman@collabora.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Eric, Ted, This is v7 of this series (thank you for the feedback!) . This picks up a few r-b tags and has one small fix asked by Eric to handle a corner case in ext4_match when IS_ENCRYPTED() and the key is added during lookup. * Original commit letter The case-insensitive implementations in f2fs and ext4 have quite a bit of duplicated code. This series simplifies the ext4 version, with the goal of extracting ext4_ci_compare into a helper library that can be used by both filesystems. It also reduces the clutter from many codeguards for CONFIG_UNICODE; as requested by Linus, they are part of the codeflow now. While there, I noticed we can leverage the utf8 functions to detect encoded names that are corrupted in the filesystem. Therefore, it also adds an ext4 error on that scenario, to mark the filesystem as corrupted. This series survived passes of xfstests -g quick. Gabriel Krisman Bertazi (8): ext4: Simplify the handling of cached insensitive names f2fs: Simplify the handling of cached insensitive names libfs: Introduce case-insensitive string comparison helper ext4: Reuse generic_ci_match for ci comparisons f2fs: Reuse generic_ci_match for ci comparisons ext4: Log error when lookup of encoded dentry fails ext4: Move CONFIG_UNICODE defguards into the code flow f2fs: Move CONFIG_UNICODE defguards into the code flow fs/ext4/ext4.h | 49 +++++++++-------- fs/ext4/namei.c | 130 ++++++++++++++++----------------------------- fs/ext4/super.c | 4 +- fs/f2fs/dir.c | 103 +++++++++++------------------------ fs/f2fs/f2fs.h | 15 +++++- fs/f2fs/namei.c | 11 ++-- fs/f2fs/recovery.c | 5 +- fs/f2fs/super.c | 8 +-- fs/libfs.c | 68 ++++++++++++++++++++++++ include/linux/fs.h | 4 ++ 10 files changed, 197 insertions(+), 200 deletions(-) -- 2.36.1