linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: tytso@mit.edu
Cc: kernel@collabora.com, linux-ext4@vger.kernel.org,
	Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Subject: [PATCH v4 7/9] tune2fs: Prevent enabling encryption flag on encoding-aware fs
Date: Fri, 30 Nov 2018 19:39:08 -0500	[thread overview]
Message-ID: <20181201003910.18982-8-krisman@collabora.com> (raw)
In-Reply-To: <20181201003910.18982-1-krisman@collabora.com>

From: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

The kernel will refuse to mount filesystems with the encryption and
encoding features enabled at the same time.  The encoding feature can
only be set at mount time, so we can just prevent encryption from being
set at a later time by tune2fs.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 misc/tune2fs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index a680b461cc86..4c92bee30b38 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1459,6 +1459,12 @@ mmp_error:
 	}
 
 	if (FEATURE_ON(E2P_FEATURE_INCOMPAT, EXT4_FEATURE_INCOMPAT_ENCRYPT)) {
+		if (ext2fs_has_feature_fname_encoding(sb)) {
+			fputs(_("Cannot enable encrypt feature on filesystems "
+				"with the encoding feature enabled.\n"),
+			      stderr);
+			return 1;
+		}
 		fs->super->s_encrypt_algos[0] =
 			EXT4_ENCRYPTION_MODE_AES_256_XTS;
 		fs->super->s_encrypt_algos[1] =
-- 
2.20.0.rc1

  parent reply	other threads:[~2018-12-01 11:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  0:39 [PATCH e2fsprogs v4 0/9] Support encoding awareness and casefold Gabriel Krisman Bertazi
2018-12-01  0:39 ` [PATCH v4 1/9] libe2p: Helpers for configuring the encoding superblock fields Gabriel Krisman Bertazi
2018-12-01  0:39 ` [PATCH v4 2/9] mke2fs: Configure encoding during superblock initialization Gabriel Krisman Bertazi
2018-12-01  0:39 ` [PATCH v4 3/9] chattr/lsattr: Support casefold attribute Gabriel Krisman Bertazi
2018-12-01  0:39 ` [PATCH v4 4/9] lib/ext2fs: Implement NLS support Gabriel Krisman Bertazi
2019-04-22 21:17   ` Eric Biggers
2018-12-01  0:39 ` [PATCH v4 5/9] lib/ext2fs: Support encoding when calculating dx hashes Gabriel Krisman Bertazi
2018-12-01  0:39 ` [PATCH v4 6/9] debugfs/htree: Support encoding when printing the file hash Gabriel Krisman Bertazi
2018-12-01  0:39 ` Gabriel Krisman Bertazi [this message]
     [not found] ` <20181201004223.25539-1-krisman@collabora.com>
2018-12-01  0:42   ` [PATCH v4 9/9] ext4.5: Add fname_encoding feature to ext4 man page Gabriel Krisman Bertazi
2018-12-03  5:18 ` [PATCH e2fsprogs v4 0/9] Support encoding awareness and casefold Theodore Y. Ts'o
2018-12-03 21:00   ` Gabriel Krisman Bertazi
2018-12-08 17:45     ` Theodore Y. Ts'o
2018-12-09  0:42       ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181201003910.18982-8-krisman@collabora.com \
    --to=krisman@collabora.com \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.co.uk \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).