[f2fs-dev] [PATCH 1/2] f2fs: fix to retrieve inline xattr space

2019-04-10 Thread Chao Yu
With below mkfs and mount option, generic/339 of fstest will report that scratch image becomes corrupted. MKFS_OPTIONS -- -O extra_attr -O project_quota -O inode_checksum -O flexible_inline_xattr -O inode_crtime -f /dev/zram1 MOUNT_OPTIONS -- -o acl,user_xattr -o discard,noinline_xattr /dev/zram

[f2fs-dev] [PATCH 2/2] f2fs: fix to use inline space only if inline_xattr is enable

2019-04-10 Thread Chao Yu
With below mkfs and mount option: MKFS_OPTIONS -- -O extra_attr -O project_quota -O inode_checksum -O flexible_inline_xattr -O inode_crtime -f MOUNT_OPTIONS -- -o noinline_xattr We may miss xattr data with below testcase: - mkdir dir - setfattr -n "user.name" -v 0 dir - for ((i = 0; i < 190; i+

Re: [f2fs-dev] [PATCH v2 1/2] vfs: use READ_ONCE() to access ->i_link

2019-04-10 Thread Al Viro
On Wed, Apr 10, 2019 at 04:15:48PM -0700, Eric Biggers wrote: > On Wed, Apr 10, 2019 at 10:06:57PM +0100, Al Viro wrote: > > On Wed, Apr 10, 2019 at 01:21:14PM -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > Use 'READ_ONCE(inode->i_link)' to explicitly support filesystems caching

[f2fs-dev] [Bug 203197] kernel read fault at __is_cp_guaranteed

2019-04-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203197 --- Comment #3 from Jungyeon (jungy...@gatech.edu) --- I've tested with kernel version 5.0.0. The image and program is okay. It just seems that the errors are keeping changing.. I also saw vma_interval_tree_insert() error. It's hard to say that

Re: [f2fs-dev] [PATCH v2 1/2] vfs: use READ_ONCE() to access ->i_link

2019-04-10 Thread Eric Biggers
On Wed, Apr 10, 2019 at 10:06:57PM +0100, Al Viro wrote: > On Wed, Apr 10, 2019 at 01:21:14PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Use 'READ_ONCE(inode->i_link)' to explicitly support filesystems caching > > the symlink target in ->i_link later if it was unavailable at iget()

Re: [f2fs-dev] [PATCH v2 1/2] vfs: use READ_ONCE() to access ->i_link

2019-04-10 Thread Al Viro
On Wed, Apr 10, 2019 at 01:21:14PM -0700, Eric Biggers wrote: > From: Eric Biggers > > Use 'READ_ONCE(inode->i_link)' to explicitly support filesystems caching > the symlink target in ->i_link later if it was unavailable at iget() > time, or wasn't easily available. I'll be doing this in fscrypt

[f2fs-dev] [PATCH v2 0/2] fscrypt: improve encrypted symlink performance

2019-04-10 Thread Eric Biggers
This series improves the performance of following encrypted symlinks on ext4, f2fs, and ubifs. Eric Biggers (2): vfs: use READ_ONCE() to access ->i_link fscrypt: cache decrypted symlink target in ->i_link fs/crypto/hooks.c | 40 +--- fs/crypto/keyinf

[f2fs-dev] [PATCH v2 1/2] vfs: use READ_ONCE() to access ->i_link

2019-04-10 Thread Eric Biggers
From: Eric Biggers Use 'READ_ONCE(inode->i_link)' to explicitly support filesystems caching the symlink target in ->i_link later if it was unavailable at iget() time, or wasn't easily available. I'll be doing this in fscrypt, to improve the performance of encrypted symlinks on ext4, f2fs, and ub

[f2fs-dev] [PATCH v2 2/2] fscrypt: cache decrypted symlink target in ->i_link

2019-04-10 Thread Eric Biggers
From: Eric Biggers Path lookups that traverse encrypted symlink(s) are very slow because each encrypted symlink needs to be decrypted each time it's followed. This also involves dropping out of rcu-walk mode. Make encrypted symlinks faster by caching the decrypted symlink target in ->i_link. Th

[f2fs-dev] [PATCH] f2fs: fix error path of recovery

2019-04-10 Thread Chao Yu
There are some places in where we missed to unlock page or unlock page incorrectly, fix them. Signed-off-by: Chao Yu --- fs/f2fs/recovery.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index e3883db868d8..d4f9d540810

[f2fs-dev] [PATCH] f2fs: fix to avoid deadloop in foreground GC

2019-04-10 Thread Chao Yu
As Jungyeon reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203211 - Overview When mounting the attached crafted image and making a new file, I got this error and the error messages keep repeating. The image is intentionally fuzzed from a normal f2fs image for testing and I r

Re: [f2fs-dev] [PATCH v4] f2fs: fix to avoid accessing xattr across the boundary

2019-04-10 Thread Chao Yu
On 2019/4/10 17:27, Randall Huang wrote: > When we traverse xattr entries via __find_xattr(), > if the raw filesystem content is faked or any hardware failure occurs, > out-of-bound error can be detected by KASAN. > Fix the issue by introducing boundary check. > > [ 38.402878] c7 1827 BUG: KAS

Re: [f2fs-dev] [PATCH v3] f2fs: fix to avoid accessing xattr across the boundary

2019-04-10 Thread Randall Huang via Linux-f2fs-devel
On Tue, Apr 09, 2019 at 06:22:55PM +0800, Chao Yu wrote: > On 2019/4/9 16:53, Randall Huang wrote: > > When we traverse xattr entries via __find_xattr(), > > if the raw filesystem content is faked or any hardware failure occurs, > > out-of-bound error can be detected by KASAN. > > Fix the issue by

[f2fs-dev] [PATCH v4] f2fs: fix to avoid accessing xattr across the boundary

2019-04-10 Thread Randall Huang via Linux-f2fs-devel
When we traverse xattr entries via __find_xattr(), if the raw filesystem content is faked or any hardware failure occurs, out-of-bound error can be detected by KASAN. Fix the issue by introducing boundary check. [ 38.402878] c7 1827 BUG: KASAN: slab-out-of-bounds in f2fs_getxattr+0x518/0x68c

[f2fs-dev] [PATCH] f2fs-tools: Change sysfs path look up logic for zoned block devices

2019-04-10 Thread Shin'ichiro Kawasaki
The mkfs.f2fs checks 'zoned' and 'chunk_sectors' sysfs attributes of zoned block devices to place F2FS areas aligned to block zone boundaries. However, mkfs.f2fs code assumes the given device name has corresponding sysfs path under /sys/block directory. This is not the case when partition devices o