Re: [f2fs-dev] [PATCH 5/5] f2fs: Handle casefolding with Encryption

2020-09-22 Thread Eric Biggers
On Wed, Sep 23, 2020 at 01:01:51AM +, Daniel Rosenberg wrote: > Expand f2fs's casefolding support to include encrypted directories. To > index casefolded+encrypted directories, we use the SipHash of the > casefolded name, keyed by a key derived from the directory's fscrypt > master key. This

Re: [f2fs-dev] [PATCH 4/5] fscrypt: Have filesystems handle their d_ops

2020-09-22 Thread Eric Biggers
On Wed, Sep 23, 2020 at 01:01:50AM +, Daniel Rosenberg wrote: > This shifts the responsibility of setting up dentry operations from > fscrypt to the individual filesystems, allowing them to have their own > operations while still setting fscrypt's d_revalidate as appropriate. > > Most filesyst

Re: [f2fs-dev] [PATCH 3/5] libfs: Add generic function for setting dentry_ops

2020-09-22 Thread Eric Biggers
On Wed, Sep 23, 2020 at 01:01:49AM +, Daniel Rosenberg wrote: > This adds a function to set dentry operations at lookup time that will > work for both encrypted files and casefolded filenames. "encrypted files" => "encrypted filenames" > > A filesystem that supports both features simultaneou

Re: [f2fs-dev] [PATCH 2/5] fscrypt: Export fscrypt_d_revalidate

2020-09-22 Thread Eric Biggers
On Wed, Sep 23, 2020 at 01:01:48AM +, Daniel Rosenberg wrote: > This is in preparation for shifting the responsibility of setting the > dentry_operations to the filesystem, allowing it to maintain its own > operations. > > Signed-off-by: Daniel Rosenberg > --- > fs/crypto/fname.c | 3 +

Re: [f2fs-dev] [PATCH v2 0/9] Update to zstd-1.4.6

2020-09-22 Thread Christoph Hellwig
FYI, as mentioned last time: clear NAK for letting these bad APIs slip into the overall kernel code. Please provide proper kernel style wrappers to avoid these kinds of updates and in the future just change APIs on an as-needed basis. ___ Linux-f2fs-d

Re: [f2fs-dev] [PATCH 1/5] ext4: Use generic casefolding support

2020-09-22 Thread Eric Biggers
On Wed, Sep 23, 2020 at 01:01:47AM +, Daniel Rosenberg wrote: > This switches ext4 over to the generic support provided in > the previous patch. > > Since casefolded dentries behave the same in ext4 and f2fs, we decrease > the maintenance burden by unifying them, and any optimizations will > i

[f2fs-dev] [PATCH 3/5] libfs: Add generic function for setting dentry_ops

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a function to set dentry operations at lookup time that will work for both encrypted files and casefolded filenames. A filesystem that supports both features simultaneously can use this function during lookup preperations to set up its dentry operations once fscrypt no longer does that i

[f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the f2fs dev branch F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. I've included one ext4 patch from the previous set since it isn't in the f2fs

[f2fs-dev] [PATCH 5/5] f2fs: Handle casefolding with Encryption

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext file

[f2fs-dev] [PATCH 2/5] fscrypt: Export fscrypt_d_revalidate

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This is in preparation for shifting the responsibility of setting the dentry_operations to the filesystem, allowing it to maintain its own operations. Signed-off-by: Daniel Rosenberg --- fs/crypto/fname.c | 3 ++- include/linux/fscrypt.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(

[f2fs-dev] [PATCH 1/5] ext4: Use generic casefolding support

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This switches ext4 over to the generic support provided in the previous patch. Since casefolded dentries behave the same in ext4 and f2fs, we decrease the maintenance burden by unifying them, and any optimizations will immediately apply to both. Signed-off-by: Daniel Rosenberg Reviewed-by: Eric

[f2fs-dev] [PATCH 4/5] fscrypt: Have filesystems handle their d_ops

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This shifts the responsibility of setting up dentry operations from fscrypt to the individual filesystems, allowing them to have their own operations while still setting fscrypt's d_revalidate as appropriate. Most filesystems can just use generic_set_encrypted_ci_d_ops, unless they have their own

[f2fs-dev] [PATCH v2 8/9] lib: unzstd: Switch to the zstd-1.4.6 API

2020-09-22 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- lib/decompress_unzstd.c | 40 ++-- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/lib/de

[f2fs-dev] [PATCH v2 7/9] squashfs: zstd: Switch to the zstd-1.4.6 API

2020-09-22 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/squashfs/zstd_wrapper.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/squashfs/zstd_wrapper.c b/fs/squas

[f2fs-dev] [PATCH v2 9/9] lib: zstd: Remove zstd compatibility wrapper

2020-09-22 Thread Nick Terrell
From: Nick Terrell All callers have been transitioned to the new zstd-1.4.6 API. There are no more callers of the zstd compatibility wrapper, so delete it. Signed-off-by: Nick Terrell --- include/linux/zstd_compat.h | 116 1 file changed, 116 deletions(-)

[f2fs-dev] [PATCH v2 4/9] crypto: zstd: Switch to zstd-1.4.6 API

2020-09-22 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- crypto/zstd.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/crypto/zstd.c b/crypto/zstd.c in

[f2fs-dev] [PATCH v2 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-22 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is more efficient because it uses the single-pass API instead of the streaming API. The streaming API is not necessary because the whole input and output buffers are available. This saves memory because w

[f2fs-dev] [PATCH v2 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-22 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/btrfs/zstd.c | 48 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/fs/btr

[f2fs-dev] [PATCH v2 2/9] lib: zstd: Add decompress_sources.h for decompress_unzstd

2020-09-22 Thread Nick Terrell
From: Nick Terrell Adds decompress_sources.h which includes every .c file necessary for zstd decompression. This is used in decompress_unzstd.c so the internal structure of the library isn't exposed. This allows us to upgrade the zstd library version without modifying any callers. Instead we jus

[f2fs-dev] [PATCH v2 0/9] Update to zstd-1.4.6

2020-09-22 Thread Nick Terrell
From: Nick Terrell This patchset upgrades the zstd library to the latest upstream release. The current zstd version in the kernel is a modified version of upstream zstd-1.3.1. At the time it was integrated, zstd wasn't ready to be used in the kernel as-is. But, it is now possible to use upstream

[f2fs-dev] [PATCH v2 1/9] lib: zstd: Add zstd compatibility wrapper

2020-09-22 Thread Nick Terrell
From: Nick Terrell Adds zstd_compat.h which provides the necessary functions from the current zstd.h API. It is only active for zstd versions 1.4.6 and newer. That means it is disabled currently, but will become active when a later patch in this series updates the zstd library in the kernel to 1.

Re: [f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Jaegeuk Kim
On 09/22, Eric Biggers wrote: > On Tue, Sep 22, 2020 at 03:48:02AM -0700, Daniel Rosenberg wrote: > > These patches are on top of the f2fs dev branch > > > > F2FS currently supports casefolding and encryption, but not at > > the same time. These patches aim to rectify that. In a later follow up, >

Re: [f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Eric Biggers
On Tue, Sep 22, 2020 at 03:48:02AM -0700, Daniel Rosenberg wrote: > These patches are on top of the f2fs dev branch > > F2FS currently supports casefolding and encryption, but not at > the same time. These patches aim to rectify that. In a later follow up, > this will be added for Ext4 as well. I'

Re: [f2fs-dev] [PATCH v3 00/13] fscrypt: improve file creation flow

2020-09-22 Thread Eric Biggers
On Tue, Sep 22, 2020 at 07:29:45AM -0400, Jeff Layton wrote: > > > > All applied to fscrypt.git#master for 5.10. > > > > I'd still really appreciate more reviews and acks, though. > > > > You can add this to all of the fscrypt: patches. I've tested this under > the ceph patchset and it seems to

Re: [f2fs-dev] [PATCH v3 00/13] fscrypt: improve file creation flow

2020-09-22 Thread Jeff Layton
On Mon, 2020-09-21 at 15:35 -0700, Eric Biggers wrote: > On Wed, Sep 16, 2020 at 09:11:23PM -0700, Eric Biggers wrote: > > Hello, > > > > This series reworks the implementation of creating new encrypted files > > by introducing new helper functions that allow filesystems to set up the > > inodes'

[f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the f2fs dev branch F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. I've included one ext4 patch from the previous set since it isn't in the f2fs