Re: [f2fs-dev] [PATCH 1/1] fsck.f2fs: allow to fix inconsistency from online resize

2019-07-03 Thread sunqiuyang
A quick comment: if cp.user_block_count is corrupted due to resize failure, then cp.free_segment_count will also be corrupted. Then in fsck_verify(), we will find the check "free segment_count matched with CP" fails, and still call fix_checkpoint() later. Thanks, ___

Re: [f2fs-dev] [PATCH v6 10/17] fs-verity: implement FS_IOC_ENABLE_VERITY ioctl

2019-07-03 Thread Eric Biggers
On Mon, Jul 01, 2019 at 08:32:30AM -0700, Eric Biggers wrote: > + err = mnt_want_write_file(filp); > + if (err) /* -EROFS */ > + return err; > + > + err = deny_write_access(filp); > + if (err) /* -ETXTBSY */ > + goto out_drop_write; > + > + inode_lock(ino

[f2fs-dev] [PATCH] f2fs: support swap file w/ DIO

2019-07-03 Thread Jaegeuk Kim
Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 142 ++-- fs/f2fs/f2fs.h | 5 +- include/trace/events/f2fs.h | 11 +-- 3 files changed, 143 insertions(+), 15 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 1e2d924e2ea7.

[f2fs-dev] [PATCH v3] f2fs: avoid out-of-range memory access

2019-07-03 Thread Ocean Chen via Linux-f2fs-devel
blk_off might over 512 due to fs corrupt and should be checked before being used. Use ENTRIES_IN_SUM to protect invalid memory access. -- v2: - fix typo v3: - check blk_off before being used -- Signed-off-by: Ocean Chen --- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

Re: [f2fs-dev] [PATCH v2] f2fs: avoid out-of-range memory access

2019-07-03 Thread Ocean Chen via Linux-f2fs-devel
Hi Yu Chao, The cur_data_segno only was checked in mount process. In terms of security concern, it's better to check value before using it. I know the risk is low. IMHO, it can be safer. BTW, I found we can only check blk_off before for loop instead of checking 'j' in each iteratoin. On Wed, Jul