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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 CA3B2C433DF for ; Fri, 3 Jul 2020 01:04:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 966572070C for ; Fri, 3 Jul 2020 01:04:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HmfCP9UX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="oOqDzf9U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 966572070C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VHDu8RPz0ceW7QdYuguAESqNmOz5juNhCNLQsWW45fY=; b=HmfCP9UXwxrScMC/fpNunLqOl uOcMOKVVyFlw9/v5Eh+e9g/QjAU7JR+/NHKMda5OZ+TIGzBVx67lb27OqdI86WtCu9Av7NeMvov99 7ghUSTdiOAhiKA0OlogHOGqS8d0fikHefzjPEOiK/4+on1UrHmIIWpPLKfgOaVeBiaYTSWs/sv8JW qB7qNwWHJFlZWRPCNshYZBNmZe5PvICugc6SdvGbMswymkFQYszLcqb3ELZH0V00zCUftk2fUN/cB D8a9RNFAXgA5mO7PsKTCxV4rr0AYXEi43ozG4Mnc/AdvTs98+zJP24x1U4ZdlcSnbDS/Hq5cXTs9D KKmgFRIbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrA5T-0002dA-KO; Fri, 03 Jul 2020 01:01:55 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrA5Q-0002c0-OW for linux-mtd@lists.infradead.org; Fri, 03 Jul 2020 01:01:53 +0000 Received: by mail-ot1-x341.google.com with SMTP id 5so23529421oty.11 for ; Thu, 02 Jul 2020 18:01:50 -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=+0u5TnXqElmJHIUbIwfyg0UnTaWODXR+GC+hM1QsUz4=; b=oOqDzf9UhdHQiWfizW6yxKYuiXycU3fWLPwduq8AH7hV/7gSiEHYYCaf1R8F2ctgqG Ctt5zAILp2PI93b4Q9sIqk+bct1cHbzT8Yw9+IcOxwWKgWbCaachSWq9et+Yf8XtLZAo 4PfjLQ2EBIkG8ZapbfVu6Be6/Vu8TcYpCdwMqVXiYNjxd4suP9wdDfoO3oqnw035dU8n /R6DDvFq0BMQXLdQ3Ov60bKRizaMZFmcKMO6VN+JDo/z+/DFAUQ/rBIJ0OdRJmHbICOW lVBzFxBYsXOkdcGMH5/fGPjcJF+UWV/JV1fhleZLJ4KwG6qXoSH5MyKRsJ+/bO2HGygC mIWw== 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=+0u5TnXqElmJHIUbIwfyg0UnTaWODXR+GC+hM1QsUz4=; b=qwRbJU+Th98aMhzUh0sG+sXmQbSm8W2phq3RYeZ9lye0wlHb4mP8hDEfLnhCN80b2W uJ4vTfmeaTIJYz+6uypuYHkWGk/XITTBSUW0fOylUZCwwJ8++7nSsBE7/nzTWvs3h51P O2qjQAdjPykOj7mxnSYltbVTZr2rGiIZh4N5QMJYfuKSGNAd6tUgAdCHJPYNnHLc6RCO qzQ5wFkm+gxcjpM8ldABoz+HG6dsXhAsd8r9NVSNL23bA0L9iGBdrSOdSeqzRLr7GAzP owffzPtmdVeCNz45RKD7W2iw6zADEqG7Q0mbGPOKtkCrWXPL7rR86g+ei9ORQSp675Xe kAhg== X-Gm-Message-State: AOAM5338Y/RDDLLpE0+IUCrZFJHLwoZq+E8vCbeqb3YriGICQojhCUd5 mw70CFxHcj7s8lMiclr1kd0J0M9243kCYge2pamx6g== X-Google-Smtp-Source: ABdhPJxyzjPijsRL1V11XOG//slLi4ypOVvA8gCAeJn23Y/3chvpbEFZmi5lFQBGL/hRDveD1WrFac5iKC6RBaNTr+k= X-Received: by 2002:a9d:6d98:: with SMTP id x24mr18707612otp.93.1593738109138; Thu, 02 Jul 2020 18:01:49 -0700 (PDT) MIME-Version: 1.0 References: <20200624043341.33364-1-drosen@google.com> <20200624043341.33364-3-drosen@google.com> <20200624055707.GG844@sol.localdomain> In-Reply-To: <20200624055707.GG844@sol.localdomain> From: Daniel Rosenberg Date: Thu, 2 Jul 2020 18:01:37 -0700 Message-ID: Subject: Re: [PATCH v9 2/4] fs: Add standard casefolding support To: Eric Biggers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200702_210152_813098_AD59D689 X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, Theodore Ts'o , Jonathan Corbet , Richard Weinberger , Andreas Dilger , Chao Yu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org, Alexander Viro , linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Tue, Jun 23, 2020 at 10:57 PM Eric Biggers wrote: > > Note that the '!IS_ENCRYPTED(dir) || fscrypt_has_encryption_key(dir)' check can > be racy, because a process can be looking up a no-key token in a directory while > concurrently another process initializes the directory's ->i_crypt_info, causing > fscrypt_has_encryption_key(dir) to suddenly start returning true. > > In my rework of filename handling in f2fs, I actually ended up removing all > calls to needs_casefold(), thus avoiding this race. f2fs now decides whether > the name is going to need casefolding early on, in __f2fs_setup_filename(), > where it knows in a race-free way whether the filename is a no-key token or not. > > Perhaps ext4 should work the same way? It did look like there would be some > extra complexity due to how the ext4 directory hashing works in comparison to > f2fs's, but I haven't had a chance to properly investigate it. > > - Eric Hm. I think I should be able to just check for DCACHE_ENCRYPTED_NAME in the dentry here, right? I'm just trying to avoid casefolding the no-key token, and that flag should indicate that. I'll see if I can rework the ext4 patches to not need needs_casefold as well, since then there'd be no need to export it. -Daniel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/