From patchwork Thu May 19 21:23:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 1633560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=VHzlb5p5; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L42t01T9sz9sG0 for ; Fri, 20 May 2022 07:24:08 +1000 (AEST) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4L42t00fMrz4xD8 for ; Fri, 20 May 2022 07:24:08 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4L42t00bDjz4xD9; Fri, 20 May 2022 07:24:08 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=VHzlb5p5; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4L42t00VcXz4xD8 for ; Fri, 20 May 2022 07:24:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238695AbiESVYH (ORCPT ); Thu, 19 May 2022 17:24:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiESVYG (ORCPT ); Thu, 19 May 2022 17:24:06 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E806AED787 for ; Thu, 19 May 2022 14:24:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 880C01F45EB1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652995444; bh=xCVBbVqmp/7jdLxAOUghr2fFaWRVCwCpo6pL22/iD0s=; h=From:To:Cc:Subject:Date:From; b=VHzlb5p5uTnIJL9Fs9GAtX9nIvNF1bAC5lywlDj7RP7kYwQQG7YI+TSyIJExeaqjR nNC3SBrlIOSLYpznDuIfg7ULqavjlBfshG0DGu+P5L7M71Ksn8Gh8GIvRGGOmKx2Pa hU2M7T8jrNzXh020lHr2Uak9srNi+0Dn6CLDNexowOV2yK+0H4vLCFlhglSj0iqtyg tPEwsTkigWYsKGPM+LORkOCQ8Vm3hzEBOCvjLlV+8+AUU3vpnVUH6ZvZAMyWEjUi0F /BNAvVj7a9lQQZBhtYPEJiAlooJXOVxcxKtfAEUtrujgphiz6M4/SiBV9WCtTOyIL2 BwSXjXMdvxkGw== 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 v8 0/8] Clean up the case-insensitive lookup path Date: Thu, 19 May 2022 17:23:51 -0400 Message-Id: <20220519212359.19442-1-krisman@collabora.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 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(-)