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=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 E7C2DC4332B for ; Fri, 19 Mar 2021 07:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3D3B64F72 for ; Fri, 19 Mar 2021 07:35:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbhCSHeq (ORCPT ); Fri, 19 Mar 2021 03:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234158AbhCSHeS (ORCPT ); Fri, 19 Mar 2021 03:34:18 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9D6C061760 for ; Fri, 19 Mar 2021 00:34:18 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id p133so9657021qka.17 for ; Fri, 19 Mar 2021 00:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=urQzhmgOX5AXOQJelfFx/ncldq6kmhxylYkJ5Acgg0A=; b=QOPJ+ioSziS+Wf9i0JARXPRnSFZX6sRlJV06RqmoiYGZJc0MdP5qz6mHzq1Driyviz 4LtSeSyjUegPikBilpxWUqHG5cbI06J1boqmC93ApsaVy3OA1M2mI8dSlUuYs5/lZB1V uHXzh3mFxrz0Y5k6/TSvPX9jCU2ThvAPrPYo+t9TpX80dVBtoJjFrQlRfUgaU6WgDUFa XZr1LZeDCLhMPbkXUHbtcCgckzZmP74OlPBmy2/nBfUkJF3y+1LcbA5RQJxsLk4i1sem Jp9e3imzPycUqOlqWJrWv61tOAnTeeef87QwHPlmLRYxxygG+rvIeC8EXt/IoOjNt75q LwDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=urQzhmgOX5AXOQJelfFx/ncldq6kmhxylYkJ5Acgg0A=; b=BZcgjjxaZZ9bnm+jd+zJq3WnttUWIeYsVe+G5nSOcw5SiDhs4DkGz3B3Tet8G+HK8H DvXybDoBGAEEK98Ycfjy67uENM0I9LzqzZdxtvWAoRmoJ1GxlFaYBgR+XE7v3mWHI7Rw 4snpKJv93SPYG69ncdaGe35gcRJOS53ZQj8yyoFgLipObzkmr4qLsNFIBb5GYlxVCZJ2 tb903MMW4Fv/oEaack2Z8MRebSCbAbTnBX6g4nR1vcY1Oi9+l8IN8mFffiiIbjaHTfMi 0vSCrl38A+toVEURotXncr+VgcdzZypmcmdyRAOdcLHXyVhMQ5j7KthBfXFSiTTk2LBj /bCA== X-Gm-Message-State: AOAM530vdyvavhzH89PvJ1IkzkFuJXnXRPQ6zwLFyZYJOE5nMqNenLX1 e3Vnzcac60HS/y/gnGnoZtG2vSbytYs= X-Google-Smtp-Source: ABdhPJwy5IwhzBUxuVwRL9I5c7SyWw+SoJMjyf25SWTCFCyYeQD5/Qspx04SMnRws89ao6EHcSpGp4yIYrE= X-Received: from drosen.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:4e6f]) (user=drosen job=sendgmr) by 2002:a0c:8623:: with SMTP id p32mr8077081qva.23.1616139257477; Fri, 19 Mar 2021 00:34:17 -0700 (PDT) Date: Fri, 19 Mar 2021 07:34:12 +0000 Message-Id: <20210319073414.1381041-1-drosen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH v2 0/2] Reconcile Encryption and Casefolding in Ext4 From: Daniel Rosenberg To: "Theodore Y . Ts'o" , Eric Biggers , Andreas Dilger , linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi , kernel-team@android.com, Daniel Rosenberg Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These patches add support for ext4 encryption and casefolding at the same time. Since the hash for encrypted casefolded directory names cannot be computed without the key, we need to store the hash on disk. We only do so for encrypted and casefolded directories to avoid on disk format changes. e2fsprogs has already been updated with support for casefolding and encryption. v2 changes: When checking for 'fake' entries (which do not include the extra hash bytes) -Check for . and .. using names instead of position -Check for csum entries via file_type instead of position -Assume last entry in directory will be csum for __ext4_check_entry if csum enabled This means we don't need to pass along lblk all over the place -Don't use siphash value for find_group_orlov, just use regular hash Daniel Rosenberg (2): ext4: Handle casefolding with encryption ext4: Optimize match for casefolded encrypted dirs Documentation/filesystems/ext4/directory.rst | 27 +++ fs/ext4/dir.c | 37 +++- fs/ext4/ext4.h | 73 +++++-- fs/ext4/hash.c | 25 ++- fs/ext4/inline.c | 25 ++- fs/ext4/namei.c | 213 ++++++++++++++----- fs/ext4/super.c | 6 - 7 files changed, 303 insertions(+), 103 deletions(-) base-commit: f296bfd5cd04cbb49b8fc9585adc280ab2b58624 -- 2.31.0.rc2.261.g7f71774620-goog