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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B769C38145 for ; Thu, 8 Sep 2022 19:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbiIHT1v (ORCPT ); Thu, 8 Sep 2022 15:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232001AbiIHT1u (ORCPT ); Thu, 8 Sep 2022 15:27:50 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 775908E0FB for ; Thu, 8 Sep 2022 12:27:49 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id k12so1035039qkj.8 for ; Thu, 08 Sep 2022 12:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=uJuSEBAP6rRmrIWIihpoeQUrSgdohwiep3NB3gaWFo8=; b=yOlyV7wO/K1OUz538EHIg5BEWLzOUoIbe/xVlYV5eND8thb58u5gUIB1TnmxVUrqr0 yqR3sjJwDzY/lLXtMLhy3clM7I8hz4cofsAZC3y6nJecgbVAdJ0wob/BYoKYNLnkWYSM cL5wrJ/dX3IvNILBL0u9lCqw9xBVZgg+Q7KdWJFhd6K8O5tO3tJ2yCPZq8zr5xqQ1aO1 WwAmuZs1RoPQMEnFL0kzQqNfmog/i05rKEoBg6PwDWJkBPsbcH1cJcCtadFe3wZKdLXg QpbsuW++91IGbQjOTsNXlJICtjVL0WJ6ci6S/vgxqT8hIKuFClz1PQHqZr3sUCgOYpQb +NgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=uJuSEBAP6rRmrIWIihpoeQUrSgdohwiep3NB3gaWFo8=; b=45vxnLMCuifLq1sTlvlZDtY57JNa55QpXhPD2HOZV86DCATAoqqGof7V4WTxJhl5sw zg4yoXFS/2TOJf1zFlrKmUVJFR4l076O7WLkWLTp6uZYJdqfU4iPqkyfkZBWuugscIpT bfX8mTOlJmdFNg+DYrNXrq3OlQ9HV6dZg7S3PvdaLd7LOqDtXi35joQmQbSm+HTE9xNS cx9gokNPShmgyIGx5QBmsLRxOPrTKKvcFOvbNX/d7HjkJYrZOJmggyy0OxtBDAcMWOYd sp45tzkFJzfQHCTcKxYxww51BUklrRBdH3Qj9zLe3wcadm0QrIPbA3/9ym9O/v8TCvaB Kz0w== X-Gm-Message-State: ACgBeo2pLHZmIMV0a8Qv8ZTGaXUX/S/3Jd9OeWKybuDT6VOAmv4eXswY ZnYGixCbNRzaU8SMCVAP5fBXuA== X-Google-Smtp-Source: AA6agR5b101O8bqi/mKgFUPKgcze67lg/xw/eC/6lXVh2fXekpAJIuULI5EMueFWazFpTkS2hHppVg== X-Received: by 2002:a05:620a:4394:b0:6be:6fdb:a7b2 with SMTP id a20-20020a05620a439400b006be6fdba7b2mr7252830qkp.345.1662665268491; Thu, 08 Sep 2022 12:27:48 -0700 (PDT) Received: from localhost (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id m11-20020a05620a290b00b006bb87c4833asm18673091qkp.109.2022.09.08.12.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 12:27:47 -0700 (PDT) Date: Thu, 8 Sep 2022 15:27:46 -0400 From: Josef Bacik To: Sweet Tea Dorminy Cc: "Theodore Y. Ts'o" , Jaegeuk Kim , Eric Biggers , Chris Mason , David Sterba , linux-fscrypt@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com, Omar Sandoval Subject: Re: [PATCH v2 10/20] btrfs: factor a fscrypt_name matching method Message-ID: References: <685c8abce7bdb110bc306752314b4fb0e7867290.1662420176.git.sweettea-kernel@dorminy.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <685c8abce7bdb110bc306752314b4fb0e7867290.1662420176.git.sweettea-kernel@dorminy.me> Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Sep 05, 2022 at 08:35:25PM -0400, Sweet Tea Dorminy wrote: > From: Omar Sandoval > > Now that everything in btrfs is dealing in fscrypt_names, fscrypt has a > useful function, fscrypt_match_name(), to check whether a fscrypt_name > matches a provided buffer. However, btrfs buffers are struct > extent_buffer rather than a raw char array, so we need to implement our > own imitation of fscrypt_match_name() that deals in extent_buffers, > falling back to a simple memcpy if fscrypt isn't compiled. We > can then use this matching method in btrfs_match_dir_item_name() and > other locations. > > This also provides a useful occasion to introduce the new fscrypt file > for btrfs, handling the fscrypt-specific functions needed. > > Signed-off-by: Omar Sandoval > Signed-off-by: Sweet Tea Dorminy The code is fine, but I was very confused about why we do this sha256 thing. Perhaps point at the code for fscrypt_nokey_name and indicate that it exists to be interoperable with no-key actions on the file system. Thanks, Josef