Re: [f2fs-dev] [PATCH v18 0/7] Case insensitive cleanup for ext4/f2fs

2024-06-06 Thread Gabriel Krisman Bertazi
to me. Feel free to add: Reviewed-by: Gabriel Krisman Bertazi Bringing Christian into the loop, since this is getting ready and it should go through the VFS tree, as it touches libfs and a couple filesystems. Christian, can you please take a look? Eric has also been involved in the review, so

Re: [f2fs-dev] [PATCH v17 3/7] libfs: Introduce case-insensitive string comparison helper

2024-06-04 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > generic_ci_match can be used by case-insensitive filesystems to compare > strings under lookup with dirents in a case-insensitive way. This > function is currently reimplemented by each filesystem supporting > ca

Re: [f2fs-dev] [PATCH v17 4/7] ext4: Reuse generic_ci_match for ci comparisons

2024-06-04 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > Instead of reimplementing ext4_match_ci, use the new libfs helper. > > It also adds a comment explaining why fname->cf_name.name must be > checked prior to the encryption hash optimization, because that tripped &g

Re: [f2fs-dev] [PATCH v16 3/9] libfs: Introduce case-insensitive string comparison helper

2024-05-28 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > On 5/23/24 02:05, Gabriel Krisman Bertazi wrote: >> Eugen Hristev writes: >> >>> On 5/13/24 00:27, Gabriel Krisman Bertazi wrote: >>>> Eric Biggers writes: >>>> >>>>> On Fri, Apr 05, 2024 at 03:13:2

Re: [f2fs-dev] [PATCH v16 3/9] libfs: Introduce case-insensitive string comparison helper

2024-05-22 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > On 5/13/24 00:27, Gabriel Krisman Bertazi wrote: >> Eric Biggers writes: >> >>> On Fri, Apr 05, 2024 at 03:13:26PM +0300, Eugen Hristev wrote: >> >>>> + if (WARN_ON_ONCE(!fscrypt_has_encryption_key(parent

Re: [f2fs-dev] [PATCH v16 3/9] libfs: Introduce case-insensitive string comparison helper

2024-05-12 Thread Gabriel Krisman Bertazi
t.len)) >> +goto out; >> +res = utf8_strncasecmp_folded(um, folded_name, &dirent); > > Shouldn't the memcmp be done with the original user-specified name, not the > casefolded name? I would think that the user-specified name is the one

Re: [f2fs-dev] [PATCH v16 0/9] Cache insensitive cleanup for ext4/f2fs

2024-04-05 Thread Gabriel Krisman Bertazi
ck look, the series is looking good and the strict mode issue pointed in the last iteration seems fixed, though I didn't run it yet. I'll take a closer look later today and fully review. -- Gabriel Krisman Bertazi ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v15 7/9] f2fs: Log error when lookup of encoded dentry fails

2024-04-04 Thread Gabriel Krisman Bertazi
trigger on a bad lookup, which is caught >>> earlier, only if the actual disk name is bad. >>> >>> Suggested-by: Gabriel Krisman Bertazi >>> Signed-off-by: Eugen Hristev >>> --- >>> fs/f2fs/dir.c | 15 ++- >>> 1 f

Re: [f2fs-dev] [PATCH v15 6/9] ext4: Log error when lookup of encoded dentry fails

2024-04-03 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Tue, Apr 02, 2024 at 06:48:39PM +0300, Eugen Hristev via Linux-f2fs-devel > wrote: >> From: Gabriel Krisman Bertazi >> > I'm seeing this error when the volume is *not* in strict mode and a file has a > name that is not valid UTF-8. Th

Re: [f2fs-dev] [PATCH v14 8/9] ext4: Move CONFIG_UNICODE defguards into the code flow

2024-03-25 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > Instead of a bunch of ifdefs, make the unicode built checks part of the > code flow where possible, as requested by Torvalds. > > Signed-off-by: Gabriel Krisman Bertazi > [eugen.hris...@collabora.com: port to 6.8

Re: [f2fs-dev] [PATCH v10 7/8] ext4: Move CONFIG_UNICODE defguards into the code flow

2024-03-22 Thread Gabriel Krisman Bertazi
Eugen Hristev via Linux-f2fs-devel writes: > From: Gabriel Krisman Bertazi > > Instead of a bunch of ifdefs, make the unicode built checks part of the > code flow where possible, as requested by Torvalds. > > Reviewed-by: Eric Biggers > Signed-off-by: Gabriel Krisman B

Re: [f2fs-dev] [PATCH v14 7/9] f2fs: Log error when lookup of encoded dentry fails

2024-03-22 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > If the volume is in strict mode, generi c_ci_compare can report a broken > encoding name. This will not trigger on a bad lookup, which is caught > earlier, only if the actual disk name is bad. > > Suggested-by: Gabriel Krisman Bertazi > Signed-off

Re: [f2fs-dev] [PATCH v13 2/9] f2fs: Simplify the handling of cached insensitive names

2024-03-14 Thread Gabriel Krisman Bertazi
/dev/loop0 export TEST_DIR=$BASEMNT/test export RESULT_BASE=${BASEMNT}/results export REPORT_DIR=${BASEMNT}/report export FSTYP=f2fs mkfs.f2fs -f -C utf8 -O casefold ${TEST_DEV} ./check -g encrypt,quick -- Gabriel Krisman Bertazi ___ Linux-f2fs-

Re: [f2fs-dev] [PATCH v13 2/9] f2fs: Simplify the handling of cached insensitive names

2024-03-13 Thread Gabriel Krisman Bertazi
62] PKRU: 5554 [ 75.792112] Kernel panic - not syncing: Fatal exception [ 75.792797] Kernel Offset: 0x2a0 from 0x8100 (relocation range: 0xffff8000-0xbfff) -- Gabriel Krisman Bertazi ___ Linux-f2fs-devel maili

Re: [f2fs-dev] [PATCH v13 3/9] libfs: Introduce case-insensitive string comparison helper

2024-03-13 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > generic_ci_match can be used by case-insensitive filesystems to compare > strings under lookup with dirents in a case-insensitive way. This > function is currently reimplemented by each filesystem supporting > ca

Re: [f2fs-dev] [PATCH v12 0/8] Cache insensitive cleanup for ext4/f2fs

2024-02-27 Thread Gabriel Krisman Bertazi
CONFIG_UNICODE; as requested by Linus, they are part of > the codeflow now. > > While there, I noticed we can leverage the utf8 functions to detect > encoded names that are corrupted in the filesystem. Therefore, it also > adds an ext4 error on that scenario, to mark the filesystem as

Re: [f2fs-dev] [PATCH v12 6/8] ext4: Log error when lookup of encoded dentry fails

2024-02-27 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > If the volume is in strict mode, ext4_ci_compare can report a broken > encoding name. This will not trigger on a bad lookup, which is caught > earlier, only if the actual disk name is bad. > > Reviewed-by: Eric Big

Re: [f2fs-dev] [PATCH v12 3/8] libfs: Introduce case-insensitive string comparison helper

2024-02-27 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > generic_ci_match can be used by case-insensitive filesystems to compare > strings under lookup with dirents in a case-insensitive way. This > function is currently reimplemented by each filesystem supporting > ca

Re: [f2fs-dev] [PATCH v12 2/8] f2fs: Simplify the handling of cached insensitive names

2024-02-27 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > Keeping it as qstr avoids the unnecessary conversion in f2fs_match > > Reviewed-by: Eric Biggers > Signed-off-by: Gabriel Krisman Bertazi > [eugen.hris...@collabora.com: port to 6.8-rc3] > Signed-off-by: Eugen H

Re: [f2fs-dev] [PATCH v7 00/10] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-02-27 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Wed, Feb 21, 2024 at 12:14:02PM -0500, Gabriel Krisman Bertazi wrote: >> >> When case-insensitive and fscrypt were adapted to work together, we moved the >> code that sets the dentry operations for case-insensitive dentries(d_hash and >>

[f2fs-dev] [PATCH v7 10/10] libfs: Drop generic_set_encrypted_ci_d_ops

2024-02-21 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive capable filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v7 08/10] f2fs: Configure dentry operations at dentry-creation time

2024-02-21 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v7 06/10] libfs: Add helper to choose dentry operations at mount-time

2024-02-21 Thread Gabriel Krisman Bertazi
ned-off-by: Gabriel Krisman Bertazi --- changes since v3: - Fix typo in comment (Eric) --- fs/libfs.c | 28 include/linux/fs.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index c4be0961faf0..0aa388ee82ff 100644 --- a/fs/libf

[f2fs-dev] [PATCH v7 07/10] ext4: Configure dentry operations at dentry-creation time

2024-02-21 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi Acked-by:

[f2fs-dev] [PATCH v7 09/10] ubifs: Configure dentry operations at dentry-creation time

2024-02-21 Thread Gabriel Krisman Bertazi
fscrypt now supports configuring dentry operations at dentry-creation time through the preset sb->s_d_op, instead of at lookup time. Enable this in ubifs, since the lookup-time mechanism is going away. Signed-off-by: Gabriel Krisman Bertazi --- fs/ubifs/dir.c | 1 - fs/ubifs/super.c | 1 +

[f2fs-dev] [PATCH v7 00/10] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-02-21 Thread Gabriel Krisman Bertazi
IV/ Gabriel Krisman Bertazi (10): ovl: Always reject mounting over case-insensitive directories fscrypt: Factor out a helper to configure the lookup dentry fscrypt: Drop d_revalidate for valid dentries during lookup fscrypt: Drop d_revalidate once the key is added libfs: Merge encrypted_ci_de

[f2fs-dev] [PATCH v7 04/10] fscrypt: Drop d_revalidate once the key is added

2024-02-21 Thread Gabriel Krisman Bertazi
worst, we will get an extra d_revalidate on the keyed dentry, which will still find the dentry to be valid. Finally, now that we do more than just clear the DCACHE_NOKEY_NAME in fscrypt_handle_d_move, skip it entirely for plaintext dentries, to avoid extra costs. Signed-off-by: Gabriel Krism

[f2fs-dev] [PATCH v7 05/10] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-02-21 Thread Gabriel Krisman Bertazi
In preparation to get case-insensitive dentry operations from sb->s_d_op again, use the same structure with and without fscrypt. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed

[f2fs-dev] [PATCH v7 02/10] fscrypt: Factor out a helper to configure the lookup dentry

2024-02-21 Thread Gabriel Krisman Bertazi
-by: Gabriel Krisman Bertazi --- changes since v7 - Fix function names in commit message (Eric) - Have a stub for the CONFIG_FS_ENCRYPTION=n case (Eric) changes since v6 - Use inline comparison for is_nokey_name (eric) - rename fscrypt_prepare_lookup_dentry->fscrypt_prepare_dentry (eric) -

[f2fs-dev] [PATCH v7 01/10] ovl: Always reject mounting over case-insensitive directories

2024-02-21 Thread Gabriel Krisman Bertazi
ed when we move d_op configuration back to ->s_d_op. Yet, we better have an explicit fix to avoid messing up again. While there, re-sort the entries to have more descriptive error messages first. Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops") Signed-off-by: Ga

[f2fs-dev] [PATCH v7 03/10] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-02-21 Thread Gabriel Krisman Bertazi
actually need to write the flag. Signed-off-by: Gabriel Krisman Bertazi --- changes since v5 - d_set_always_valid -> d_revalidate (eric) - Avoid acquiring the lock for !fscrypt-capable filesystems (eric, Christian) --- include/linux/fscrypt.h | 22 ++ 1 file changed,

Re: [f2fs-dev] [PATCH v6 03/10] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-02-20 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Mon, Feb 12, 2024 at 09:13:14PM -0500, Gabriel Krisman Bertazi wrote: >> Finally, we need to clean the dentry->flags even for unencrypted >> dentries, so the ->d_lock might be acquired even for them. In order to > > might => must? &

Re: [f2fs-dev] [PATCH v10 3/8] libfs: Introduce case-insensitive string comparison helper

2024-02-20 Thread Gabriel Krisman Bertazi
tive, and you get these apparent weird semantics. Not ideal from a user point of view. But not a kernel bug. If it pushes people away from using case-insensitive directories in their day-to-day work and leave it to only be used by Windows compatibility

Re: [f2fs-dev] [PATCH v6 04/10] fscrypt: Drop d_revalidate once the key is added

2024-02-19 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Wed, Feb 14, 2024 at 04:16:31PM -0800, Eric Biggers wrote: >> On Mon, Feb 12, 2024 at 09:13:15PM -0500, Gabriel Krisman Bertazi wrote: >> > From fscrypt perspective, once the key is available, the dentry will >> > remain valid until evict

Re: [f2fs-dev] [PATCH v10 3/8] libfs: Introduce case-insensitive string comparison helper

2024-02-19 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > On 2/16/24 18:12, Gabriel Krisman Bertazi wrote: >> Eugen Hristev writes: >> >>> From: Gabriel Krisman Bertazi >>> >>> generic_ci_match can be used by case-insensitive filesystems to compare >>> strings under l

Re: [f2fs-dev] [PATCH v10 3/8] libfs: Introduce case-insensitive string comparison helper

2024-02-16 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > generic_ci_match can be used by case-insensitive filesystems to compare > strings under lookup with dirents in a case-insensitive way. This > function is currently reimplemented by each filesystem supporting > ca

Re: [f2fs-dev] [RESEND PATCH v9 1/3] libfs: Introduce case-insensitive string comparison helper

2024-02-13 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > On 2/9/24 16:40, Gabriel Krisman Bertazi wrote: >> Eugen Hristev writes: > With the changes you suggested, I get these errors now : > > [ 107.409410] EXT4-fs error (device sda1): ext4_lookup:1816: inode #521217: > comm > ls: 'CUC'

[f2fs-dev] [PATCH v6 10/10] libfs: Drop generic_set_encrypted_ci_d_ops

2024-02-12 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive capable filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v6 09/10] ubifs: Configure dentry operations at dentry-creation time

2024-02-12 Thread Gabriel Krisman Bertazi
fscrypt now supports configuring dentry operations at dentry-creation time through the preset sb->s_d_op, instead of at lookup time. Enable this in ubifs, since the lookup-time mechanism is going away. Signed-off-by: Gabriel Krisman Bertazi --- fs/ubifs/dir.c | 1 - fs/ubifs/super.c | 1 +

[f2fs-dev] [PATCH v6 02/10] fscrypt: Factor out a helper to configure the lookup dentry

2024-02-12 Thread Gabriel Krisman Bertazi
ble. Signed-off-by: Gabriel Krisman Bertazi --- changes since v6 - Use inline comparison for is_nokey_name (eric) - rename fscrypt_prepare_lookup_dentry->fscrypt_prepare_dentry (eric) --- fs/crypto/hooks.c | 15 +-- include/linux/fscrypt.h | 10 ++ 2 files chang

[f2fs-dev] [PATCH v6 07/10] ext4: Configure dentry operations at dentry-creation time

2024-02-12 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi Acked-by:

[f2fs-dev] [PATCH v6 01/10] ovl: Always reject mounting over case-insensitive directories

2024-02-12 Thread Gabriel Krisman Bertazi
ed when we move d_op configuration back to ->s_d_op. Yet, we better have an explicit fix to avoid messing up again. While there, re-sort the entries to have more descriptive error messages first. Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops") Signed-off-by: Ga

[f2fs-dev] [PATCH v6 08/10] f2fs: Configure dentry operations at dentry-creation time

2024-02-12 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v6 05/10] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-02-12 Thread Gabriel Krisman Bertazi
In preparation to get case-insensitive dentry operations from sb->s_d_op again, use the same structure with and without fscrypt. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed

[f2fs-dev] [PATCH v6 06/10] libfs: Add helper to choose dentry operations at mount-time

2024-02-12 Thread Gabriel Krisman Bertazi
ned-off-by: Gabriel Krisman Bertazi --- changes since v3: - Fix typo in comment (Eric) --- fs/libfs.c | 28 include/linux/fs.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index c4be0961faf0..0aa388ee82ff 100644 --- a/fs/libf

[f2fs-dev] [PATCH v6 04/10] fscrypt: Drop d_revalidate once the key is added

2024-02-12 Thread Gabriel Krisman Bertazi
entirely for plaintext dentries, to avoid extra costs. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v5: - Merge with another patch(eric) - revert conditional check (eric) - drop comment (eric) Changes since v3: - Fix null-ptr-deref for filesystems that don't support fsc

[f2fs-dev] [PATCH v6 03/10] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-02-12 Thread Gabriel Krisman Bertazi
actually need to write the flag. Signed-off-by: Gabriel Krisman Bertazi --- changes since v5 - d_set_always_valid -> d_revalidate (eric) - Avoid acquiring the lock for !fscrypt-capable filesystems (eric, Christian) --- include/linux/fscrypt.h | 22 ++ 1 file changed,

[f2fs-dev] [PATCH v6 00/10] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-02-12 Thread Gabriel Krisman Bertazi
quick groups without regressions. Based on v6.7-rc1. [1] https://lore.kernel.org/linux-fsdevel/20231123195327.GP38156@ZenIV/ [2] https://lore.kernel.org/linux-fsdevel/20231123171255.GN38156@ZenIV/ Gabriel Krisman Bertazi (10): ovl: Always reject mounting over case-insensitive directories fsc

Re: [f2fs-dev] [PATCH v5 04/12] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-02-09 Thread Gabriel Krisman Bertazi
Christian Brauner writes: > On Fri, Feb 02, 2024 at 11:50:07AM -0300, Gabriel Krisman Bertazi wrote: >> Eric Biggers writes: >> >> > On Wed, Jan 31, 2024 at 03:35:40PM -0300, Gabriel Krisman Bertazi wrote: >> >> Eric Biggers writes: >> >>

Re: [f2fs-dev] [RESEND PATCH v9 1/3] libfs: Introduce case-insensitive string comparison helper

2024-02-09 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > On 2/8/24 20:38, Gabriel Krisman Bertazi wrote: >> (untested) > > I implemented your suggestion, but any idea about testing ? I ran smoke on > xfstests > and it appears to be fine, but maybe some specific test case might try the > different

Re: [f2fs-dev] [RESEND PATCH v9 2/3] ext4: Reuse generic_ci_match for ci comparisons

2024-02-08 Thread Gabriel Krisman Bertazi
gt; + * corruption or ENOMEM. > + */ > + return false; A minor problem with splitting the series as you did is that "ext4: Log error when lookup of encoded dentry fails" conflicts with this change and

Re: [f2fs-dev] [RESEND PATCH v9 1/3] libfs: Introduce case-insensitive string comparison helper

2024-02-08 Thread Gabriel Krisman Bertazi
Eugen Hristev writes: > From: Gabriel Krisman Bertazi > > generic_ci_match can be used by case-insensitive filesystems to compare > strings under lookup with dirents in a case-insensitive way. This > function is currently reimplemented by each filesystem supporting > ca

Re: [f2fs-dev] [PATCH v5 04/12] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-02-02 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Wed, Jan 31, 2024 at 03:35:40PM -0300, Gabriel Krisman Bertazi wrote: >> Eric Biggers writes: >> >> > On Mon, Jan 29, 2024 at 05:43:22PM -0300, Gabriel Krisman Bertazi wrote: >> >> Unencrypted and encrypted-dentries where the key

Re: [f2fs-dev] [PATCH v5 04/12] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-01-31 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Mon, Jan 29, 2024 at 05:43:22PM -0300, Gabriel Krisman Bertazi wrote: >> Unencrypted and encrypted-dentries where the key is available don't need >> to be revalidated with regards to fscrypt, since they don't go stale >> from under VFS an

Re: [f2fs-dev] [PATCH v5 01/12] ovl: Reject mounting over case-insensitive directories

2024-01-30 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Mon, Jan 29, 2024 at 05:43:19PM -0300, Gabriel Krisman Bertazi wrote: >> ovl: Reject mounting over case-insensitive directories > > Maybe: > > ovl: Reject mounting over rootdir of case-insensitive capable FS > > or: > > ovl:

[f2fs-dev] [PATCH v5 11/12] ubifs: Configure dentry operations at dentry-creation time

2024-01-29 Thread Gabriel Krisman Bertazi
fscrypt now supports configuring dentry operations at dentry-creation time through the preset sb->s_d_op, instead of at lookup time. Enable this in ubifs, since the lookup-time mechanism is going away. Signed-off-by: Gabriel Krisman Bertazi --- fs/ubifs/dir.c | 1 - fs/ubifs/super.c | 1 +

[f2fs-dev] [PATCH v5 12/12] libfs: Drop generic_set_encrypted_ci_d_ops

2024-01-29 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v5 10/12] f2fs: Configure dentry operations at dentry-creation time

2024-01-29 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v5 08/12] libfs: Add helper to choose dentry operations at mount-time

2024-01-29 Thread Gabriel Krisman Bertazi
ned-off-by: Gabriel Krisman Bertazi --- changes since v3: - Fix typo in comment (Eric) --- fs/libfs.c | 28 include/linux/fs.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index c4be0961faf0..0aa388ee82ff 100644 --- a/fs/libf

[f2fs-dev] [PATCH v5 09/12] ext4: Configure dentry operations at dentry-creation time

2024-01-29 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v5 07/12] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-01-29 Thread Gabriel Krisman Bertazi
us, we'll only have only pay the cost once, and not per-lookup. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/fs/libfs.c b/fs/libfs

[f2fs-dev] [PATCH v5 05/12] fscrypt: Drop d_revalidate once the key is added

2024-01-29 Thread Gabriel Krisman Bertazi
e holding the d_lock. We might race with a concurrent RCU lookup but this is harmless because, at worst, we will get an extra d_revalidate on the keyed dentry, which is will find the dentry is valid. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v3: - Fix null-ptr-deref for filesyste

[f2fs-dev] [PATCH v5 06/12] fscrypt: Ignore plaintext dentries during d_move

2024-01-29 Thread Gabriel Krisman Bertazi
fscrypt code instead of the caller. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v4: - Check based on the dentry itself (eric) --- include/linux/fscrypt.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index c1e285053b3e

[f2fs-dev] [PATCH v5 03/12] fscrypt: Call fscrypt_prepare_lookup_dentry on unencrypted dentries

2024-01-29 Thread Gabriel Krisman Bertazi
In preparation to dropping DCACHE_OP_REVALIDATE for dentries that don't need it at lookup time, refactor the code to make unencrypted denties also call fscrypt_prepare_dentry. This makes the non-inline __fscrypt_prepare_lookup superfulous, so drop it. Signed-off-by: Gabriel Krisman Be

[f2fs-dev] [PATCH v5 02/12] fscrypt: Factor out a helper to configure the lookup dentry

2024-01-29 Thread Gabriel Krisman Bertazi
ble. Signed-off-by: Gabriel Krisman Bertazi --- fs/crypto/hooks.c | 18 -- include/linux/fscrypt.h | 10 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 52504dd478d3..71463cef08f9 100644 --- a/fs/crypto/hook

[f2fs-dev] [PATCH v5 00/12] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-01-29 Thread Gabriel Krisman Bertazi
V/ [2] https://lore.kernel.org/linux-fsdevel/20231123171255.GN38156@ZenIV/ Gabriel Krisman Bertazi (12): ovl: Reject mounting over case-insensitive directories fscrypt: Factor out a helper to configure the lookup dentry fscrypt: Call fscrypt_prepare_lookup_dentry on unencrypted dentries f

[f2fs-dev] [PATCH v5 01/12] ovl: Reject mounting over case-insensitive directories

2024-01-29 Thread Gabriel Krisman Bertazi
, re-sort the entries to have more descriptive error messages first. Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops") Signed-off-by: Gabriel Krisman Bertazi Acked-by: Amir Goldstein --- changes since v3: - Case insensitive filesystem ->Case insensitive capable f

[f2fs-dev] [PATCH v5 04/12] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-01-29 Thread Gabriel Krisman Bertazi
nnecessary revalidation, in preparation to always configuring d_op through sb->s_d_op. Since the filesystem might have other features that require revalidation, only apply this optimization if the d_revalidate handler is fscrypt_d_revalidate itself. Signed-off-by: Gabriel Krisman Bertazi ---

Re: [f2fs-dev] [PATCH v3 04/10] fscrypt: Drop d_revalidate once the key is added

2024-01-29 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Thu, Jan 25, 2024 at 05:20:56PM -0300, Gabriel Krisman Bertazi wrote: >> Eric Biggers writes: >> >> > On Fri, Jan 19, 2024 at 03:47:36PM -0300, Gabriel Krisman Bertazi wrote: >> >> /* >> >> * When d_splice

[f2fs-dev] [PATCH v4 12/12] libfs: Drop generic_set_encrypted_ci_d_ops

2024-01-26 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v4 09/12] ext4: Configure dentry operations at dentry-creation time

2024-01-26 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v4 10/12] f2fs: Configure dentry operations at dentry-creation time

2024-01-26 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v4 11/12] ubifs: Configure dentry operations at dentry-creation time

2024-01-26 Thread Gabriel Krisman Bertazi
fscrypt now supports configuring dentry operations at dentry-creation time through the preset sb->s_d_op, instead of at lookup time. Enable this in ubifs, since the lookup-time mechanism is going away. Signed-off-by: Gabriel Krisman Bertazi --- fs/ubifs/dir.c | 1 - fs/ubifs/super.c | 1 +

[f2fs-dev] [PATCH v4 06/12] fscrypt: Ignore non-fscrypt volumes during d_move

2024-01-26 Thread Gabriel Krisman Bertazi
o the check in the callee to avoid polluting the caller code with header guards. Signed-off-by: Gabriel Krisman Bertazi --- include/linux/fscrypt.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index c1e285053b3e..566362fdc3af 100644

[f2fs-dev] [PATCH v4 08/12] libfs: Add helper to choose dentry operations at mount-time

2024-01-26 Thread Gabriel Krisman Bertazi
ned-off-by: Gabriel Krisman Bertazi --- changes since v3: - Fix typo in comment (Eric) --- fs/libfs.c | 28 include/linux/fs.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index c4be0961faf0..0aa388ee82ff 100644 --- a/fs/libf

[f2fs-dev] [PATCH v4 07/12] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-01-26 Thread Gabriel Krisman Bertazi
us, we'll only have only pay the cost once, and not per-lookup. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/fs/libfs.c b/fs/libfs

[f2fs-dev] [PATCH v4 03/12] fscrypt: Call fscrypt_prepare_lookup_dentry on unencrypted dentries

2024-01-26 Thread Gabriel Krisman Bertazi
In preparation to dropping DCACHE_OP_REVALIDATE for dentries that don't need it at lookup time, refactor the code to make unencrypted denties also call fscrypt_prepare_dentry. This makes the non-inline __fscrypt_prepare_lookup superfulous, so drop it. Signed-off-by: Gabriel Krisman Be

[f2fs-dev] [PATCH v4 01/12] ovl: Reject mounting over case-insensitive directories

2024-01-26 Thread Gabriel Krisman Bertazi
, re-sort the entries to have more descriptive error messages first. Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops") Signed-off-by: Gabriel Krisman Bertazi Acked-by: Amir Goldstein --- changes since v3: - Case insensitive filesystem ->Case insensitive capable f

[f2fs-dev] [PATCH v4 00/12] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-01-26 Thread Gabriel Krisman Bertazi
ives fstests encrypt and quick groups without regressions. Based on v6.7-rc1. [1] https://lore.kernel.org/linux-fsdevel/20231123195327.GP38156@ZenIV/ [2] https://lore.kernel.org/linux-fsdevel/20231123171255.GN38156@ZenIV/ Gabriel Krisman Bertazi (12): ovl: Reject mounting over case-insensitive

[f2fs-dev] [PATCH v4 04/12] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-01-26 Thread Gabriel Krisman Bertazi
nnecessary revalidation, in preparation to always configuring d_op through sb->s_d_op. Since the filesystem might have other features that require revalidation, only apply this optimization if the d_revalidate handler is fscrypt_d_revalidate itself. Signed-off-by: Gabriel Krisman Bertazi ---

[f2fs-dev] [PATCH v4 02/12] fscrypt: Factor out a helper to configure the lookup dentry

2024-01-26 Thread Gabriel Krisman Bertazi
ble. Signed-off-by: Gabriel Krisman Bertazi --- fs/crypto/hooks.c | 18 -- include/linux/fscrypt.h | 10 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 52504dd478d3..71463cef08f9 100644 --- a/fs/crypto/hook

[f2fs-dev] [PATCH v4 05/12] fscrypt: Drop d_revalidate once the key is added

2024-01-26 Thread Gabriel Krisman Bertazi
e holding the d_lock. We might race with a concurrent RCU lookup but this is harmless because, at worst, we will get an extra d_revalidate on the keyed dentry, which is will find the dentry is valid. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v3: - Fix null-ptr-deref for filesyste

Re: [f2fs-dev] [PATCH v3 04/10] fscrypt: Drop d_revalidate once the key is added

2024-01-25 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Fri, Jan 19, 2024 at 03:47:36PM -0300, Gabriel Krisman Bertazi wrote: >> /* >> * When d_splice_alias() moves a directory's no-key alias to its plaintext >> alias >> * as a result of the encryption key being added, DCACHE_NOKEY_NAME m

Re: [f2fs-dev] [PATCH v3 02/10] fscrypt: Share code between functions that prepare lookup

2024-01-25 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Fri, Jan 19, 2024 at 03:47:34PM -0300, Gabriel Krisman Bertazi wrote: >> To make the patch simpler, we now call fscrypt_get_encryption_info twice >> for fscrypt_prepare_lookup, once inside fscrypt_setup_filename and once >> inside fscrypt_prepa

Re: [f2fs-dev] [PATCH v3 01/10] ovl: Reject mounting case-insensitive filesystems

2024-01-25 Thread Gabriel Krisman Bertazi
Eric Biggers writes: > On Fri, Jan 19, 2024 at 03:47:33PM -0300, Gabriel Krisman Bertazi wrote: >> ovl: Reject mounting case-insensitive filesystems > > Overlayfs doesn't mount filesystems. I think you might mean something like > reject case-insensitive lowerdirs? uppe

[f2fs-dev] [PATCH v3 09/10] ubifs: Configure dentry operations at dentry-creation time

2024-01-19 Thread Gabriel Krisman Bertazi
fscrypt now supports configuring dentry operations at dentry-creation time through the preset sb->s_d_op, instead of at lookup time. Enable this in ubifs, since the lookup-time mechanism is going away. Signed-off-by: Gabriel Krisman Bertazi --- fs/ubifs/dir.c | 1 - fs/ubifs/super.c | 1 +

[f2fs-dev] [PATCH v3 10/10] libfs: Drop generic_set_encrypted_ci_d_ops

2024-01-19 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v3 06/10] libfs: Add helper to choose dentry operations at mount

2024-01-19 Thread Gabriel Krisman Bertazi
ned-off-by: Gabriel Krisman Bertazi --- fs/libfs.c | 29 + include/linux/fs.h | 1 + 2 files changed, 30 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index c4be0961faf0..9cd4df6969d2 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1822,6 +1822,35 @@ v

[f2fs-dev] [PATCH v3 08/10] f2fs: Configure dentry operations at dentry-creation time

2024-01-19 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v3 07/10] ext4: Configure dentry operations at dentry-creation time

2024-01-19 Thread Gabriel Krisman Bertazi
>lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi --- fs

[f2fs-dev] [PATCH v3 05/10] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-01-19 Thread Gabriel Krisman Bertazi
us, we'll only have only pay the cost once, and not per-lookup. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/fs/libfs.c b/fs/libfs

[f2fs-dev] [PATCH v3 03/10] fscrypt: Drop d_revalidate for valid dentries during lookup

2024-01-19 Thread Gabriel Krisman Bertazi
nnecessary revalidation, in preparation to always configuring d_op through sb->s_d_op. Since the filesystem might have other features that require revalidation, only apply this optimization if the d_revalidate handler is fscrypt_d_revalidate itself. Signed-off-by: Gabriel Krisman Bertazi -

[f2fs-dev] [PATCH v3 04/10] fscrypt: Drop d_revalidate once the key is added

2024-01-19 Thread Gabriel Krisman Bertazi
e holding the d_lock. We might race with a concurrent RCU lookup but this is harmless because, at worst, we will get an extra d_revalidate on the keyed dentry, which is will find the dentry is valid. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v3: - Fix null-ptr-deref for filesyste

[f2fs-dev] [PATCH v3 02/10] fscrypt: Share code between functions that prepare lookup

2024-01-19 Thread Gabriel Krisman Bertazi
sts, which yielded no regressions. Signed-off-by: Gabriel Krisman Bertazi --- fs/ceph/dir.c | 2 +- fs/ceph/file.c | 2 +- fs/crypto/hooks.c | 53 ++--- include/linux/fscrypt.h | 40 +-- 4 files changed, 47

[f2fs-dev] [PATCH v3 01/10] ovl: Reject mounting case-insensitive filesystems

2024-01-19 Thread Gabriel Krisman Bertazi
, re-sort the entries to have more descriptive error messages first. Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops") Signed-off-by: Gabriel Krisman Bertazi Acked-by: Amir Goldstein --- changes since v2: - Re-sort checks to trigger more descriptive error messages firs

[f2fs-dev] [PATCH v3 00/10] Set casefold/fscrypt dentry operations through sb->s_d_op

2024-01-19 Thread Gabriel Krisman Bertazi
by Al Viro to disable d_revalidate on some dentries on the fly. It survives fstests encrypt and quick groups without regressions. Based on v6.7-rc1. [1] https://lore.kernel.org/linux-fsdevel/20231123195327.GP38156@ZenIV/ [2] https://lore.kernel.org/linux-fsdevel/20231123171255.GN38156@ZenIV/ Gabri

Re: [PATCH v3 04/10] fscrypt: Drop d_revalidate once the key is added

2024-01-18 Thread Gabriel Krisman Bertazi
> https://github.com/intel-lab-lkp/linux/commits/Gabriel-Krisman-Bertazi/ovl-Reject-mounting-case-insensitive-filesystems/20240112-070113 > base: https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git dev-test > patch link: > https://lore.kernel.org/all/20240111225816.18117-5-kris.

[f2fs-dev] [PATCH v3 02/10] fscrypt: Share code between functions that prepare lookup

2024-01-11 Thread Gabriel Krisman Bertazi
sts, which yielded no regressions. Signed-off-by: Gabriel Krisman Bertazi --- fs/ceph/dir.c | 2 +- fs/ceph/file.c | 2 +- fs/crypto/hooks.c | 53 ++--- include/linux/fscrypt.h | 40 +-- 4 files changed, 47

[f2fs-dev] [PATCH v3 10/10] libfs: Drop generic_set_encrypted_ci_d_ops

2024-01-11 Thread Gabriel Krisman Bertazi
No filesystems depend on it anymore, and it is generally a bad idea. Since all dentries should have the same set of dentry operations in case-insensitive filesystems, it should be propagated through ->s_d_op. Signed-off-by: Gabriel Krisman Bertazi --- fs/libfs.c |

[f2fs-dev] [PATCH v3 05/10] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2024-01-11 Thread Gabriel Krisman Bertazi
us, we'll only have only pay the cost once, and not per-lookup. Signed-off-by: Gabriel Krisman Bertazi --- Changes since v1: - fix header guard (eric) --- fs/libfs.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/fs/libfs.c b/fs/libfs

  1   2   3   4   >