Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: Add f2fs stats to sysfs

2020-01-23 Thread Jaegeuk Kim
Currently f2fs stats are only available from /d/f2fs/status. This patch adds some of the f2fs stats to sysfs so that they are accessible even when debugfs is not mounted. The following sysfs nodes are added: -/sys/fs/f2fs//free_segments -/sys/fs/f2fs//cp_foreground_calls -/sys/fs/f2fs//cp_backgrou

Re: [f2fs-dev] [PATCH v5 0/6] fscrypt preparations for encryption+casefolding

2020-01-23 Thread Daniel Rosenberg via Linux-f2fs-devel
On Wed, Jan 22, 2020 at 3:06 PM Eric Biggers wrote: > > I've applied this series to fscrypt.git#master; however I'd still like > Acked-bys > from the UBIFS maintainers on the two UBIFS patches, as well as more > Reviewed-bys from anyone interested. If I don't hear anything from anyone, I > might

Re: [f2fs-dev] [PATCH] f2fs: fix to force keeping write barrier for strict fsync mode

2020-01-23 Thread Jaegeuk Kim
On 01/20, Chao Yu wrote: > If barrier is enabled, for strict fsync mode, we should force to > use atomic write semantics to avoid data corruption due to no > barrier support in lower device. > > Signed-off-by: Chao Yu > --- > fs/f2fs/file.c | 7 +++ > 1 file changed, 7 insertions(+) > > dif

[f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Eric Biggers
From: Eric Biggers Since ->d_compare() and ->d_hash() can be called in RCU-walk mode, ->d_parent and ->d_inode can be concurrently modified, and in particular, ->d_inode may be changed to NULL. For ext4_d_hash() this resulted in a reproducible NULL dereference if a lookup is done in a directory

[f2fs-dev] [PATCH 1/2] f2fs: fix dcache lookup of !casefolded directories

2020-01-23 Thread Eric Biggers
From: Eric Biggers Do the name comparison for non-casefolded directories correctly. This is analogous to ext4's commit 66883da1eee8 ("ext4: fix dcache lookup of !casefolded directories"). Fixes: 2c2eb7a300cd ("f2fs: Support case-insensitive file name lookups") Cc: # v5.4+ Signed-off-by: Eric B

[f2fs-dev] [PATCH 0/2] f2fs: fixes for f2fs_d_compare() and f2fs_d_hash()

2020-01-23 Thread Eric Biggers
This series fixes dentry comparisons and hashing on f2fs filesystems with the encoding feature enabled. Eric Biggers (2): f2fs: fix dcache lookup of !casefolded directories f2fs: fix race conditions in ->d_compare() and ->d_hash() fs/f2fs/dir.c | 11 +++ 1 file changed, 7 insertions(

[f2fs-dev] [PATCH 2/2] f2fs: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Eric Biggers
From: Eric Biggers Since ->d_compare() and ->d_hash() can be called in RCU-walk mode, ->d_parent and ->d_inode can be concurrently modified, and in particular, ->d_inode may be changed to NULL. For f2fs_d_hash() this resulted in a reproducible NULL dereference if a lookup is done in a directory

Re: [f2fs-dev] [PATCH v3 5/9] vfs: Fold casefolding into vfs

2020-01-23 Thread Daniel Rosenberg via Linux-f2fs-devel
> ... buggering the filesystems (and boxen) that never planned to use > that garbage. > I'm planning to rework this as dentry ops again. Your other comments point out some issues that also exist in the old dentry_operations, so that's a good opportunity to fix those up. How do you feel about just h

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Gao Xiang via Linux-f2fs-devel
Hi Eric, On Thu, Jan 23, 2020 at 08:12:34PM -0800, Eric Biggers wrote: > From: Eric Biggers > > Since ->d_compare() and ->d_hash() can be called in RCU-walk mode, > ->d_parent and ->d_inode can be concurrently modified, and in > particular, ->d_inode may be changed to NULL. For ext4_d_hash() th

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Eric Biggers
On Fri, Jan 24, 2020 at 01:04:25PM +0800, Gao Xiang wrote: > > diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c > > index 8964778aabefb..0129d14629881 100644 > > --- a/fs/ext4/dir.c > > +++ b/fs/ext4/dir.c > > @@ -671,9 +671,11 @@ static int ext4_d_compare(const struct dentry *dentry, > > unsigned int l

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Gao Xiang via Linux-f2fs-devel
On Thu, Jan 23, 2020 at 09:16:01PM -0800, Eric Biggers wrote: > On Fri, Jan 24, 2020 at 01:04:25PM +0800, Gao Xiang wrote: > > > diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c > > > index 8964778aabefb..0129d14629881 100644 > > > --- a/fs/ext4/dir.c > > > +++ b/fs/ext4/dir.c > > > @@ -671,9 +671,11 @@

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Eric Biggers
On Fri, Jan 24, 2020 at 01:34:23PM +0800, Gao Xiang wrote: > On Thu, Jan 23, 2020 at 09:16:01PM -0800, Eric Biggers wrote: > > [] > > > So we need READ_ONCE() to ensure that a consistent value is used. > > By the way, my understanding is all pointer could be accessed > atomicly guaranteed by com

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Gao Xiang via Linux-f2fs-devel
On Thu, Jan 23, 2020 at 09:16:01PM -0800, Eric Biggers wrote: [] > So we need READ_ONCE() to ensure that a consistent value is used. By the way, my understanding is all pointer could be accessed atomicly guaranteed by compiler. In my opinion, we generally use READ_ONCE() on pointers for other us

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Eric Biggers
On Fri, Jan 24, 2020 at 01:27:50PM +0800, Gao Xiang wrote: > On Thu, Jan 23, 2020 at 09:16:01PM -0800, Eric Biggers wrote: > > On Fri, Jan 24, 2020 at 01:04:25PM +0800, Gao Xiang wrote: > > > > diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c > > > > index 8964778aabefb..0129d14629881 100644 > > > > ---

Re: [f2fs-dev] [PATCH] ext4: fix race conditions in ->d_compare() and ->d_hash()

2020-01-23 Thread Gao Xiang via Linux-f2fs-devel
On Thu, Jan 23, 2020 at 09:42:56PM -0800, Eric Biggers wrote: > On Fri, Jan 24, 2020 at 01:34:23PM +0800, Gao Xiang wrote: > > On Thu, Jan 23, 2020 at 09:16:01PM -0800, Eric Biggers wrote: > > > > [] > > > > > So we need READ_ONCE() to ensure that a consistent value is used. > > > > By the way,