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,
___
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
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.
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
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