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

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

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

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the torvalds tree. 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. The f2fs-tools changes have already been applied. Since both fscrypt and case

[f2fs-dev] [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-18 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 v4 3/3] f2fs: Handle casefolding with Encryption

2020-11-18 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

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

2020-11-18 Thread Eric Biggers
On Wed, Nov 18, 2020 at 06:42:45AM +, 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 v3 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-18 Thread Eric Biggers
On Wed, Nov 18, 2020 at 06:42:44AM +, Daniel Rosenberg wrote: > diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c > index 1fbe6c24d705..cb3cfa6329ba 100644 > --- a/fs/crypto/fname.c > +++ b/fs/crypto/fname.c > @@ -570,7 +570,3 @@ int fscrypt_d_revalidate(struct dentry *dentry, unsigned > int

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

2020-11-18 Thread Eric Biggers
On Wed, Nov 18, 2020 at 06:42:43AM +, Daniel Rosenberg wrote: > +#if IS_ENABLED(CONFIG_UNICODE) && IS_ENABLED(CONFIG_FS_ENCRYPTION) > +static const struct dentry_operations generic_encrypted_ci_dentry_ops = { > + .d_hash = generic_ci_d_hash, > + .d_compare = generic_ci_d_compare, > +

[f2fs-dev] [PATCH] f2fs: remove writeback_inodes_sb in f2fs_remount

2020-11-18 Thread Liu Song via Linux-f2fs-devel
From: Liu Song Since sync_inodes_sb has been used, there is no need to use writeback_inodes_sb, so remove it. Signed-off-by: Liu Song --- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index be5050292caa..4d8cb17ce48b 100644 --- a/fs/f2fs/s

Re: [f2fs-dev] f2fs: cp_mutex starvation issue

2020-11-18 Thread stummala
Hi Chao, On 2020-11-18 15:37, Chao Yu wrote: Hi Sahitya, On 2020/11/18 17:47, stumm...@codeaurora.org wrote: Hi Chao, Can we consider to move the sbi->cp_mutex as well to use rw_sem similar to this patch of yours - https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/fs/f

Re: [f2fs-dev] f2fs: cp_mutex starvation issue

2020-11-18 Thread Chao Yu
Hi Sahitya, On 2020/11/18 17:47, stumm...@codeaurora.org wrote: Hi Chao, Can we consider to move the sbi->cp_mutex as well to use rw_sem similar to this patch of yours - https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/fs/f2fs?id=fb24fea75ca5ceef59f753494b2efd453606e08a

[f2fs-dev] f2fs: cp_mutex starvation issue

2020-11-18 Thread stummala
Hi Chao, Can we consider to move the sbi->cp_mutex as well to use rw_sem similar to this patch of yours - https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/fs/f2fs?id=fb24fea75ca5ceef59f753494b2efd453606e08a We are observing issues where fsync() of a high priority task ge

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

2020-11-18 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