From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: "Theodore Y. Ts'o" <tytso@mit.edu>,
linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
Daniel Rosenberg <drosen@google.com>
Subject: Re: [PATCH 3/4] fscrypt: support test_dummy_encryption=v2
Date: Mon, 18 May 2020 20:19:07 -0700 [thread overview]
Message-ID: <20200519031907.GA155398@google.com> (raw)
In-Reply-To: <20200519031115.GC954@sol.localdomain>
On 05/18, Eric Biggers wrote:
> On Mon, May 18, 2020 at 08:02:05PM -0700, Eric Biggers wrote:
> > On Mon, May 18, 2020 at 10:53:55PM -0400, Theodore Y. Ts'o wrote:
> > > On Tue, May 12, 2020 at 04:32:50PM -0700, Eric Biggers wrote:
> > > > From: Eric Biggers <ebiggers@google.com>
> > > >
> > > > v1 encryption policies are deprecated in favor of v2, and some new
> > > > features (e.g. encryption+casefolding) are only being added for v2.
> > > >
> > > > Therefore, the "test_dummy_encryption" mount option (which is used for
> > > > encryption I/O testing with xfstests) needs to support v2 policies.
> > > >
> > > > To do this, extend its syntax to be "test_dummy_encryption=v1" or
> > > > "test_dummy_encryption=v2". The existing "test_dummy_encryption" (no
> > > > argument) also continues to be accepted, to specify the default setting
> > > > -- currently v1, but the next patch changes it to v2.
> > > >
> > > > To cleanly support both v1 and v2 while also making it easy to support
> > > > specifying other encryption settings in the future (say, accepting
> > > > "$contents_mode:$filenames_mode:v2"), make ext4 and f2fs maintain a
> > > > pointer to the dummy fscrypt_context rather than using mount flags.
> > > >
> > > > To avoid concurrency issues, don't allow test_dummy_encryption to be set
> > > > or changed during a remount. (The former restriction is new, but
> > > > xfstests doesn't run into it, so no one should notice.)
> > > >
> > > > Tested with 'gce-xfstests -c {ext4,f2fs}/encrypt -g auto'. On ext4,
> > > > there are two regressions, both of which are test bugs: ext4/023 and
> > > > ext4/028 fail because they set an xattr and expect it to be stored
> > > > inline, but the increase in size of the fscrypt_context from
> > > > 24 to 40 bytes causes this xattr to be spilled into an external block.
> > > >
> > > > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > >
> > > Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> > >
> > > Looks good, but could you do me a favor and merge in this?
> > >
> > > diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
> > > index 04bfaf63752c..6c9fc9e21c13 100644
> > > --- a/fs/ext4/sysfs.c
> > > +++ b/fs/ext4/sysfs.c
> > > @@ -293,6 +293,7 @@ EXT4_ATTR_FEATURE(batched_discard);
> > > EXT4_ATTR_FEATURE(meta_bg_resize);
> > > #ifdef CONFIG_FS_ENCRYPTION
> > > EXT4_ATTR_FEATURE(encryption);
> > > +EXT4_ATTR_FEATURE(test_dummy_encryption_v2);
> > > #endif
> > > #ifdef CONFIG_UNICODE
> > > EXT4_ATTR_FEATURE(casefold);
> > > @@ -308,6 +309,7 @@ static struct attribute *ext4_feat_attrs[] = {
> > > ATTR_LIST(meta_bg_resize),
> > > #ifdef CONFIG_FS_ENCRYPTION
> > > ATTR_LIST(encryption),
> > > + ATTR_LIST(test_dummy_encryption_v2),
> > > #endif
> > > #ifdef CONFIG_UNICODE
> > > ATTR_LIST(casefold),
> > >
> > > This will make it easier to have the gce-xfstests test runner know
> > > whether or not test_dummy_encryption=v1 / test_dummy_encryption=v2
> > > will work, and whether test_dummy_encryption tests v1 or v2.
> > >
> >
> > Thanks, I'll add that. I assume you meant "Reviewed-by"?
>
> Jaegeuk, do you want /sys/fs/f2fs/features/test_dummy_encryption_v2 as well, to
> match what Ted wants for ext4? It would be the following change:
Yes, please. Thank you.
>
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index e3bbbef9b4f09e4..3162f46b3c9bfc1 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -446,6 +446,7 @@ enum feat_id {
> FEAT_SB_CHECKSUM,
> FEAT_CASEFOLD,
> FEAT_COMPRESSION,
> + FEAT_TEST_DUMMY_ENCRYPTION_V2,
> };
>
> static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> @@ -466,6 +467,7 @@ static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> case FEAT_SB_CHECKSUM:
> case FEAT_CASEFOLD:
> case FEAT_COMPRESSION:
> + case FEAT_TEST_DUMMY_ENCRYPTION_V2:
> return sprintf(buf, "supported\n");
> }
> return 0;
> @@ -563,6 +565,7 @@ F2FS_GENERAL_RO_ATTR(avg_vblocks);
>
> #ifdef CONFIG_FS_ENCRYPTION
> F2FS_FEATURE_RO_ATTR(encryption, FEAT_CRYPTO);
> +F2FS_FEATURE_RO_ATTR(test_dummy_encryption_v2, FEAT_TEST_DUMMY_ENCRYPTION_V2);
> #endif
> #ifdef CONFIG_BLK_DEV_ZONED
> F2FS_FEATURE_RO_ATTR(block_zoned, FEAT_BLKZONED);
> @@ -647,6 +650,7 @@ ATTRIBUTE_GROUPS(f2fs);
> static struct attribute *f2fs_feat_attrs[] = {
> #ifdef CONFIG_FS_ENCRYPTION
> ATTR_LIST(encryption),
> + ATTR_LIST(test_dummy_encryption_v2),
> #endif
> #ifdef CONFIG_BLK_DEV_ZONED
> ATTR_LIST(block_zoned),
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org,
"Theodore Y. Ts'o" <tytso@mit.edu>,
Daniel Rosenberg <drosen@google.com>,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 3/4] fscrypt: support test_dummy_encryption=v2
Date: Mon, 18 May 2020 20:19:07 -0700 [thread overview]
Message-ID: <20200519031907.GA155398@google.com> (raw)
In-Reply-To: <20200519031115.GC954@sol.localdomain>
On 05/18, Eric Biggers wrote:
> On Mon, May 18, 2020 at 08:02:05PM -0700, Eric Biggers wrote:
> > On Mon, May 18, 2020 at 10:53:55PM -0400, Theodore Y. Ts'o wrote:
> > > On Tue, May 12, 2020 at 04:32:50PM -0700, Eric Biggers wrote:
> > > > From: Eric Biggers <ebiggers@google.com>
> > > >
> > > > v1 encryption policies are deprecated in favor of v2, and some new
> > > > features (e.g. encryption+casefolding) are only being added for v2.
> > > >
> > > > Therefore, the "test_dummy_encryption" mount option (which is used for
> > > > encryption I/O testing with xfstests) needs to support v2 policies.
> > > >
> > > > To do this, extend its syntax to be "test_dummy_encryption=v1" or
> > > > "test_dummy_encryption=v2". The existing "test_dummy_encryption" (no
> > > > argument) also continues to be accepted, to specify the default setting
> > > > -- currently v1, but the next patch changes it to v2.
> > > >
> > > > To cleanly support both v1 and v2 while also making it easy to support
> > > > specifying other encryption settings in the future (say, accepting
> > > > "$contents_mode:$filenames_mode:v2"), make ext4 and f2fs maintain a
> > > > pointer to the dummy fscrypt_context rather than using mount flags.
> > > >
> > > > To avoid concurrency issues, don't allow test_dummy_encryption to be set
> > > > or changed during a remount. (The former restriction is new, but
> > > > xfstests doesn't run into it, so no one should notice.)
> > > >
> > > > Tested with 'gce-xfstests -c {ext4,f2fs}/encrypt -g auto'. On ext4,
> > > > there are two regressions, both of which are test bugs: ext4/023 and
> > > > ext4/028 fail because they set an xattr and expect it to be stored
> > > > inline, but the increase in size of the fscrypt_context from
> > > > 24 to 40 bytes causes this xattr to be spilled into an external block.
> > > >
> > > > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > >
> > > Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> > >
> > > Looks good, but could you do me a favor and merge in this?
> > >
> > > diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
> > > index 04bfaf63752c..6c9fc9e21c13 100644
> > > --- a/fs/ext4/sysfs.c
> > > +++ b/fs/ext4/sysfs.c
> > > @@ -293,6 +293,7 @@ EXT4_ATTR_FEATURE(batched_discard);
> > > EXT4_ATTR_FEATURE(meta_bg_resize);
> > > #ifdef CONFIG_FS_ENCRYPTION
> > > EXT4_ATTR_FEATURE(encryption);
> > > +EXT4_ATTR_FEATURE(test_dummy_encryption_v2);
> > > #endif
> > > #ifdef CONFIG_UNICODE
> > > EXT4_ATTR_FEATURE(casefold);
> > > @@ -308,6 +309,7 @@ static struct attribute *ext4_feat_attrs[] = {
> > > ATTR_LIST(meta_bg_resize),
> > > #ifdef CONFIG_FS_ENCRYPTION
> > > ATTR_LIST(encryption),
> > > + ATTR_LIST(test_dummy_encryption_v2),
> > > #endif
> > > #ifdef CONFIG_UNICODE
> > > ATTR_LIST(casefold),
> > >
> > > This will make it easier to have the gce-xfstests test runner know
> > > whether or not test_dummy_encryption=v1 / test_dummy_encryption=v2
> > > will work, and whether test_dummy_encryption tests v1 or v2.
> > >
> >
> > Thanks, I'll add that. I assume you meant "Reviewed-by"?
>
> Jaegeuk, do you want /sys/fs/f2fs/features/test_dummy_encryption_v2 as well, to
> match what Ted wants for ext4? It would be the following change:
Yes, please. Thank you.
>
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index e3bbbef9b4f09e4..3162f46b3c9bfc1 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -446,6 +446,7 @@ enum feat_id {
> FEAT_SB_CHECKSUM,
> FEAT_CASEFOLD,
> FEAT_COMPRESSION,
> + FEAT_TEST_DUMMY_ENCRYPTION_V2,
> };
>
> static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> @@ -466,6 +467,7 @@ static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> case FEAT_SB_CHECKSUM:
> case FEAT_CASEFOLD:
> case FEAT_COMPRESSION:
> + case FEAT_TEST_DUMMY_ENCRYPTION_V2:
> return sprintf(buf, "supported\n");
> }
> return 0;
> @@ -563,6 +565,7 @@ F2FS_GENERAL_RO_ATTR(avg_vblocks);
>
> #ifdef CONFIG_FS_ENCRYPTION
> F2FS_FEATURE_RO_ATTR(encryption, FEAT_CRYPTO);
> +F2FS_FEATURE_RO_ATTR(test_dummy_encryption_v2, FEAT_TEST_DUMMY_ENCRYPTION_V2);
> #endif
> #ifdef CONFIG_BLK_DEV_ZONED
> F2FS_FEATURE_RO_ATTR(block_zoned, FEAT_BLKZONED);
> @@ -647,6 +650,7 @@ ATTRIBUTE_GROUPS(f2fs);
> static struct attribute *f2fs_feat_attrs[] = {
> #ifdef CONFIG_FS_ENCRYPTION
> ATTR_LIST(encryption),
> + ATTR_LIST(test_dummy_encryption_v2),
> #endif
> #ifdef CONFIG_BLK_DEV_ZONED
> ATTR_LIST(block_zoned),
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-05-19 3:19 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 23:32 [PATCH 0/4] fscrypt: make '-o test_dummy_encryption' support v2 policies Eric Biggers
2020-05-12 23:32 ` [f2fs-dev] " Eric Biggers
2020-05-12 23:32 ` [PATCH 1/4] linux/parser.h: add include guards Eric Biggers
2020-05-12 23:32 ` [f2fs-dev] " Eric Biggers
2020-05-13 0:53 ` Theodore Y. Ts'o
2020-05-13 0:53 ` [f2fs-dev] " Theodore Y. Ts'o
2020-05-13 3:06 ` Jaegeuk Kim
2020-05-13 3:06 ` [f2fs-dev] " Jaegeuk Kim
2020-05-12 23:32 ` [PATCH 2/4] fscrypt: add fscrypt_add_test_dummy_key() Eric Biggers
2020-05-12 23:32 ` [f2fs-dev] " Eric Biggers
2020-05-13 0:55 ` Theodore Y. Ts'o
2020-05-13 0:55 ` [f2fs-dev] " Theodore Y. Ts'o
2020-05-13 3:07 ` Jaegeuk Kim
2020-05-13 3:07 ` [f2fs-dev] " Jaegeuk Kim
2020-05-12 23:32 ` [PATCH 3/4] fscrypt: support test_dummy_encryption=v2 Eric Biggers
2020-05-12 23:32 ` [f2fs-dev] " Eric Biggers
2020-05-13 3:11 ` Jaegeuk Kim
2020-05-13 3:11 ` [f2fs-dev] " Jaegeuk Kim
2020-05-19 2:53 ` Theodore Y. Ts'o
2020-05-19 2:53 ` [f2fs-dev] " Theodore Y. Ts'o
2020-05-19 3:02 ` Eric Biggers
2020-05-19 3:02 ` [f2fs-dev] " Eric Biggers
2020-05-19 3:11 ` Eric Biggers
2020-05-19 3:11 ` [f2fs-dev] " Eric Biggers
2020-05-19 3:19 ` Jaegeuk Kim [this message]
2020-05-19 3:19 ` Jaegeuk Kim
2020-05-19 14:02 ` Theodore Y. Ts'o
2020-05-19 14:02 ` [f2fs-dev] " Theodore Y. Ts'o
2020-05-12 23:32 ` [PATCH 4/4] fscrypt: make test_dummy_encryption use v2 by default Eric Biggers
2020-05-12 23:32 ` [f2fs-dev] " Eric Biggers
2020-05-13 3:12 ` Jaegeuk Kim
2020-05-13 3:12 ` [f2fs-dev] " Jaegeuk Kim
2020-05-19 2:55 ` Theodore Y. Ts'o
2020-05-19 2:55 ` [f2fs-dev] " Theodore Y. Ts'o
2020-05-20 22:55 ` [PATCH 0/4] fscrypt: make '-o test_dummy_encryption' support v2 policies Eric Biggers
2020-05-20 22:55 ` [f2fs-dev] " Eric Biggers
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=20200519031907.GA155398@google.com \
--to=jaegeuk@kernel.org \
--cc=drosen@google.com \
--cc=ebiggers@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.