From nobody Mon Feb 9 16:51:46 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7698035F8D9 for ; Fri, 6 Feb 2026 18:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770402241; cv=none; b=OPEBWbuOe6DM4hD9wDL+VP98c4nJWkQhVXKQn0o9P3bVp/mN8XU9ycsLzHhF+064KLs/tr/EWDO/8U+WwGLOo5U4XDZmXbNsIECZ0ERafsmGPvoH/e7xJnEn9KtKhHqkRgpw+OfiIjThaa5kieTV5wJIHuxELMDfZnupNmEcmfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770402241; c=relaxed/simple; bh=rIJCalTOBjrp9Aa9W7ors/hXzQdyQ6RUvbzFdOLTmXo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZMt78WTgS549J9KtJi64oYyFdBavvEDTu+/eIcS5pkLbQTdKCxwwYVJH0lbDlW+f9oKR3LucUBpZrT+1Xa/91mA1jqweDZcYbzo7TLll1mgQtBPozizIeq6FGanv7opPBFJi4Chq7yb9zlnAxI2EP39vnxGLbSdSok+Pc2RKdCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 115373E742; Fri, 6 Feb 2026 18:23:55 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DA34C3EA63; Fri, 6 Feb 2026 18:23:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SHbQNLoxhmkTCQAAD6G6ig (envelope-from ); Fri, 06 Feb 2026 18:23:54 +0000 From: Daniel Vacek To: Chris Mason , Josef Bacik , Eric Biggers , "Theodore Y. Ts'o" , Jaegeuk Kim , Jens Axboe , David Sterba Cc: linux-block@vger.kernel.org, Daniel Vacek , linux-fscrypt@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 02/43] fscrypt: allow inline encryption for extent based encryption Date: Fri, 6 Feb 2026 19:22:34 +0100 Message-ID: <20260206182336.1397715-3-neelx@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260206182336.1397715-1-neelx@suse.com> References: <20260206182336.1397715-1-neelx@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 115373E742 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Level: Content-Type: text/plain; charset="utf-8" From: Josef Bacik Instead of requiring -o inlinecrypt to enable inline encryption, allow having s_cop->has_per_extent_encryption to indicate that this file system supports inline encryption. Signed-off-by: Josef Bacik Signed-off-by: Daniel Vacek --- v5: https://lore.kernel.org/linux-btrfs/ba0289bf103653d5d98ef576756c9a2a661= 92865.1706116485.git.josef@toxicpanda.com/ * No changes since. --- fs/crypto/inline_crypt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c index 0d62bce2114a..38a729700552 100644 --- a/fs/crypto/inline_crypt.c +++ b/fs/crypto/inline_crypt.c @@ -108,8 +108,11 @@ int fscrypt_select_encryption_impl(struct fscrypt_inod= e_info *ci, if (ci->ci_mode->blk_crypto_mode =3D=3D BLK_ENCRYPTION_MODE_INVALID) return 0; =20 - /* The filesystem must be mounted with -o inlinecrypt */ - if (!(sb->s_flags & SB_INLINECRYPT)) + /* + * The filesystem must be mounted with -o inlinecrypt or have + * has_per_extent_encryption enabled. + */ + if (!(sb->s_flags & SB_INLINECRYPT) && !sb->s_cop->has_per_extent_encrypt= ion) return 0; =20 /* --=20 2.51.0