From patchwork Thu Nov 10 14:12:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niels de Vos X-Patchwork-Id: 13038835 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 D7FA2C4332F for ; Thu, 10 Nov 2022 14:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbiKJONy (ORCPT ); Thu, 10 Nov 2022 09:13:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiKJONm (ORCPT ); Thu, 10 Nov 2022 09:13:42 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBE1C6DCDB for ; Thu, 10 Nov 2022 06:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668089562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sG+jutGzOgaFRFm9buFpKva94M9MOYUWoscJc0fFXY0=; b=bRh843jEwPoJ56k/I0fqQGOzd42DZDnG+kRfmzxE7loZVxUayNRSL0uYFlmgbrYdU1aW5X zTOz7x2ItoVc0e8s8aBGKPfvKKYCeazqsmqn28qzaVKZOLXGHzjIVfo8IucGgFlFePr6+Z g8j0TA+v4XJsF/IS6WTKtDM6p8CG5zw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-oBEUIxlkMK-zTLbNQHjk3g-1; Thu, 10 Nov 2022 09:12:38 -0500 X-MC-Unique: oBEUIxlkMK-zTLbNQHjk3g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 76BA5833A0D; Thu, 10 Nov 2022 14:12:37 +0000 (UTC) Received: from localhost (unknown [10.39.208.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36B1C4EA5A; Thu, 10 Nov 2022 14:12:37 +0000 (UTC) From: Niels de Vos To: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Xiubo Li , Marcel Lauhoff , Niels de Vos Subject: [RFC 0/4] fs: provide per-filesystem options to disable fscrypt Date: Thu, 10 Nov 2022 15:12:21 +0100 Message-Id: <20221110141225.2308856-1-ndevos@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org While more filesystems are getting support for fscrypt, it is useful to be able to disable fscrypt for a selection of filesystems, while enabling it for others. The new USE_FS_ENCRYPTION define gets picked up in include/linux/fscrypt.h. This allows filesystems to choose to use the empty function definitions, or the functional ones when fscrypt is to be used with the filesystem. Using USE_FS_ENCRYPTION is a relatively clean approach, and requires minimal changes to the filesystems supporting fscrypt. This RFC is mostly for checking the acceptance of this solution, or if an other direction is preferred. --- Niels de Vos (4): fscrypt: introduce USE_FS_ENCRYPTION fs: make fscrypt support an ext4 config option fs: make fscrypt support a f2fs config option fs: make fscrypt support a UBIFS config option Documentation/filesystems/fscrypt.rst | 2 +- fs/crypto/Kconfig | 3 +++ fs/crypto/fscrypt_private.h | 2 ++ fs/ext4/Kconfig | 13 ++++++++++++- fs/ext4/Makefile | 2 +- fs/ext4/ext4.h | 12 ++++++++---- fs/ext4/inode.c | 6 +++--- fs/ext4/namei.c | 6 +++--- fs/ext4/super.c | 6 +++--- fs/ext4/sysfs.c | 8 ++++---- fs/f2fs/Kconfig | 15 +++++++++++++-- fs/f2fs/data.c | 2 +- fs/f2fs/dir.c | 6 +++--- fs/f2fs/f2fs.h | 8 ++++++-- fs/f2fs/super.c | 6 +++--- fs/f2fs/sysfs.c | 8 ++++---- fs/ubifs/Kconfig | 14 ++++++++++++-- fs/ubifs/Makefile | 2 +- fs/ubifs/sb.c | 4 ++-- fs/ubifs/ubifs.h | 7 +++++-- include/linux/fscrypt.h | 6 +++--- 21 files changed, 93 insertions(+), 45 deletions(-)