[f2fs-dev] [PATCH] f2fs: introduce "strict_fsync" for posix standard fsync

2018-02-01 Thread Junling Zheng
uot;strict_fsync" to control the policy of fsync. It's set by default, and means that fsync follows POSIX semantics. And "nostrict_fsync" means that the behaviour is in line with xfs, ext4 and btrfs, on which generic/342 will be passed. Signed-off-by: Junling Zheng --- fs/f2f

[f2fs-dev] [PATCH v2] f2fs: introduce "strict_fsync" for posix standard fsync

2018-02-02 Thread Junling Zheng
uot;strict_fsync" to control the policy of fsync. It's set by default, and means that fsync follows POSIX semantics. And "nostrict_fsync" means that the behaviour is in line with xfs, ext4 and btrfs, where generic/342 will pass. Signed-off-by: Junling Zheng Reviewed-by: Chao Yu

[f2fs-dev] [PATCH] dump.f2fs: correct the seg type in ssa_dump

2018-02-06 Thread Junling Zheng
Fix the mixed using of "ret" in ssa_dump. Signed-off-by: Junling Zheng --- fsck/dump.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 8772a62..23e4f47 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -195,7 +195,7 @@ voi

Re: [f2fs-dev] [PATCH v2] f2fs: introduce "strict_fsync" for posix standard fsync

2018-02-10 Thread Junling Zheng
Hi, Jaegeuk On 2018/2/10 8:44, Jaegeuk Kim wrote: > On 02/02, Junling Zheng wrote: >> Commit "0a007b97aad6"(f2fs: recover directory operations by fsync) >> fixed xfstest generic/342 case, but it also increased the written >> data and caused the performance degr

[f2fs-dev] [PATCH v3] f2fs: introduce "fsync={posix, strict}" mount options

2018-02-13 Thread Junling Zheng
ic/342 will pass, but the performance will regress. Signed-off-by: Junling Zheng --- Changes from v2: - Change to "fsync={posix,strict}" format - Set "fsync=posix" default Changes from v1: - Add document modify - Add reviewer Documentation/filesystems/f2fs.txt |

[f2fs-dev] [PATCH v4] f2fs: introduce mount option for fsync mode

2018-02-28 Thread Junling Zheng
, where generic/342 will pass, but the performance will regress. Signed-off-by: Junling Zheng --- Changes from v3: - add fsync_mode in sbi to record fsync mode - keep the extensibility for fsync_mode Changes from v2: - Change to "fsync={posix,strict}" format - Set "fsync=posix

[f2fs-dev] [PATCH v5] f2fs: introduce mount option for fsync mode

2018-03-06 Thread Junling Zheng
, where generic/342 will pass, but the performance will regress. Signed-off-by: Junling Zheng --- Changes from v4: - restore old fsync_mode if fail to remount Changes from v3: - add fsync_mode in sbi to record fsync mode - keep the extensibility for fsync_mode Changes from v2: - Change to "fs

Re: [f2fs-dev] [PATCH 2/2] tools: sg_write_buffer: add sg_write_buffer for FFU

2018-03-13 Thread Junling Zheng
Hi, Hyojun, Jaegeuk, On 2018/3/14 8:08, Jaegeuk Kim wrote: > From: Hyojun Kim > > sg_write_buffer sources are added for FFU. > > Signed-off-by: Hyojun Kim > Signed-off-by: Jaegeuk Kim > --- > tools/sg_write_buffer/Android.bp | 27 + Maybe it's better to change Android.bp

[f2fs-dev] [PATCH] fsck.f2fs: simplify fsck_chk_quota_node in PREEN_MODE_1

2018-03-26 Thread Junling Zheng
Do not do fsck_chk_node_blk to simplify fsck_chk_quota_node in PREEN_MODE_1, as well as fsck_chk_orphan_node. Signed-off-by: Junling Zheng --- fsck/fsck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fsck/fsck.c b/fsck/fsck.c index bc91839..91c8529 100644 --- a/fsck/fsck.c +++ b/fsck

Re: [f2fs-dev] [PATCH] libf2fs: reset wanted_total_sectors by new sector_size

2018-03-27 Thread Junling Zheng
Hi, Jaegeuk: On 2018/3/28 1:19, Jaegeuk Kim wrote: > From: katao > > The args of wanted_total_sectors is calculated based > on the DEFAULT_SECTOR_SIZE(512Bytes).get_device_info(i) > may be reset dev_sector_size, we should reset the number > of wanted_total_sectors. > > This bug was reported to

[f2fs-dev] [RFC PATCH] mkfs.f2fs: use 512B as the sector size criterion

2018-03-28 Thread Junling Zheng
Use 512 bytes as the sector size criterion while specifying the amount of sectors passed to mkfs. Signed-off-by: Junling Zheng --- lib/libf2fs.c | 11 --- mkfs/f2fs_format_main.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/libf2fs.c b/lib

Re: [f2fs-dev] [RFC PATCH] mkfs.f2fs: use 512B as the sector size criterion

2018-03-28 Thread Junling Zheng
Hi Jaegeuk, On 2018/3/29 4:30, Jaegeuk Kim wrote: > Hi Junling, > > On Wed, Mar 28, 2018 at 2:04 AM, Junling Zheng <mailto:zhengjunl...@huawei.com>> wrote: > > Use 512 bytes as the sector size criterion while specifying the > amount of sectors passed to m

[f2fs-dev] [RFC PATCH v2] mkfs.f2fs: use 512B as the sector size criterion

2018-03-28 Thread Junling Zheng
Use 512 bytes as the sector size criterion while specifying the amount of sectors passed to mkfs. Signed-off-by: Junling Zheng --- Changes from v1: - specify the sector size criterion in man page - replace "Warning" with "Info" while wanted size is over device

[f2fs-dev] [PATCH] f2fs: fix a wrong condition in f2fs_skip_inode_update

2018-03-29 Thread Junling Zheng
Fix commit 97dd26ad8347 (f2fs: fix wrong AUTO_RECOVER condition). We should use ~PAGE_MASK to determine whether i_size is aligned to the f2fs's block size or not. Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/f2f

Re: [f2fs-dev] [PATCH] libf2fs: reset wanted_total_sectors by new sector_size

2018-03-30 Thread Junling Zheng
Hi, On 2018/3/30 17:28, Chao Yu wrote: > Hi All, > > On 2018/3/28 1:19, Jaegeuk Kim wrote: >> From: katao >> >> The args of wanted_total_sectors is calculated based >> on the DEFAULT_SECTOR_SIZE(512Bytes).get_device_info(i) >> may be reset dev_sector_size, we should reset the number >> of wanted

Re: [f2fs-dev] [PATCH] libf2fs: reset wanted_total_sectors by new sector_size

2018-03-30 Thread Junling Zheng
On 2018/3/30 19:26, Chao Yu wrote: > On 2018/3/30 18:51, Junling Zheng wrote: >> Hi, >> >> On 2018/3/30 17:28, Chao Yu wrote: >>> Hi All, >>> >>> On 2018/3/28 1:19, Jaegeuk Kim wrote: >>>> From: katao >>>> >>>>

[f2fs-dev] [PATCH] mkfs.f2fs: support multiple features with one "-O"

2018-04-01 Thread Junling Zheng
Now one "-O" option can support multiple features separated by a comma or blank, such as: feature1,feature2,... or "feature1 feature2 ..." Signed-off-by: Junling Zheng --- mkfs/f2fs_format_main.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deleti

Re: [f2fs-dev] [PATCH] mkfs.f2fs: support multiple features with one "-O"

2018-04-02 Thread Junling Zheng
Hi, Chao On 2018/4/2 21:35, Chao Yu wrote: > On 2018/4/2 12:19, Junling Zheng wrote: >> Now one "-O" option can support multiple features separated >> by a comma or blank, such as: >> feature1,feature2,... or "feature1 feature2 ..." > > At a glan

Re: [f2fs-dev] [PATCH] mkfs.f2fs: support multiple features with one "-O"

2018-04-03 Thread Junling Zheng
On 2018/4/3 17:24, Chao Yu wrote: > Hi Junling, > > On 2018/4/3 10:15, Junling Zheng wrote: >> Hi, Chao >> >> On 2018/4/2 21:35, Chao Yu wrote: >>> On 2018/4/2 12:19, Junling Zheng wrote: >>>> Now one "-O" option can support mul

[f2fs-dev] [PATCH v2] mkfs.f2fs: support multiple features with one "-O"

2018-04-03 Thread Junling Zheng
Now one "-O" option can support multiple features separated by a comma or blank, such as: feature1,feature2,... or "feature1 feature2 ..." Signed-off-by: Junling Zheng --- Changes from v1: - free buf to fix memory leak. mkfs/f2fs_format_main.c | 31 +++

[f2fs-dev] [PATCH v3] mkfs.f2fs: support multiple features with one "-O"

2018-04-07 Thread Junling Zheng
Now one "-O" option can support multiple features separated by a comma or blank, such as: feature1,feature2,... or "feature1 feature2 ..." Signed-off-by: Junling Zheng Reviewed-by: Chao Yu --- Changes from v1: - free buf to fix memory leak. Changes from v2: - modify usage

Re: [f2fs-dev] [PATCH] fsck.f2fs: add -O features to tune the bits

2018-04-19 Thread Junling Zheng
Hi, Jaegeuk On 2018/4/20 4:54, Jaegeuk Kim wrote: > This patch add -O features for fsck.f2fs in order to tune the feature bits. > Currently, it supports -O encrypt only. > Shall we introduce a new tool like tune.f2fs to tune the parameters of f2fs? Maybe we will tune others parameters in the fut

[f2fs-dev] [RFC PATCH] f2fs-tools: introduce tune.f2fs

2018-04-23 Thread Junling Zheng
Introduce tune.f2fs tool to change the f2fs parameters. Currently this tool only supports adding or removing encrypt feature bit in superblock. Signed-off-by: Junling Zheng --- fsck/Makefile.am | 3 ++- fsck/fsck.h | 5 + fsck/main.c | 60

Re: [f2fs-dev] [RFC PATCH] f2fs-tools: introduce tune.f2fs

2018-04-25 Thread Junling Zheng
Ping... On 2018/4/23 15:32, Junling Zheng wrote: > Introduce tune.f2fs tool to change the f2fs parameters. > Currently this tool only supports adding or removing encrypt > feature bit in superblock. > > Signed-off-by: Junling Zheng > --- > fsck/Makefile.am | 3 ++- >

[f2fs-dev] [PATCH] sload.f2fs: fix the missing of bit mask for file type

2018-05-03 Thread Junling Zheng
Fix the missing of bit mask for the file type bit fields. Signed-off-by: Junling Zheng Signed-off-by: Sheng Yong --- fsck/sload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/sload.c b/fsck/sload.c index 2842f2c..1b7a2d1 100644 --- a/fsck/sload.c +++ b/fsck/sload.c

Re: [f2fs-dev] [PATCH] sload.f2fs: fix the missing of bit mask for file type

2018-05-07 Thread Junling Zheng
Hi, Jaegeuk Could you please merge this fix into external/f2fs-tools repo for AOSP? Since we found this bug while using sload feature in Android P :) Thanks, Junling On 2018/5/3 19:25, Junling Zheng wrote: > Fix the missing of bit mask for the file type bit fields. > > Signed-off-by

Re: [f2fs-dev] [PATCH] sload.f2fs: give correct file type

2018-05-07 Thread Junling Zheng
Hi, Jaegeuk My previous patch (sload.f2fs: fix the missing of bit mask for file type) had already fix this bug :) Thanks, Junling On 2018/5/8 2:58, Jaegeuk Kim wrote: > From: Lianjun Huang > > This fixes permission error due to wrong file type. > > Signed-off-by: Lianjun Huang > Signed-off-b

[f2fs-dev] [RFC PATCH] f2fs-tools: fix blocks allocation direction inside segment

2018-05-08 Thread Junling Zheng
This fixes the block allocation direction from left to right inside one segment despite of the direction of segment allocation. Signed-off-by: Junling Zheng --- fsck/mount.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 1396a2e

[f2fs-dev] [PATCH] fsck.f2fs: do umount to free memory in out_err

2018-05-17 Thread Junling Zheng
Call f2fs_do_umount to free memory in out_err branch. Signed-off-by: Junling Zheng --- fsck/main.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index c4dd8b1..870f2d8 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -844,9 +844,6 @@ retry

Re: [f2fs-dev] [PATCH] fsck.f2fs: do umount to free memory in out_err

2018-05-17 Thread Junling Zheng
Sorry, this patch has a bug: If f2fs_do_mount fails in validate_super_block or get_valid_checkpoint, then we should only free sbi->ckpt and sbi->raw_super :( On 2018/5/17 15:57, Junling Zheng wrote: > Call f2fs_do_umount to free memory in out_err branch. > > Signed-off-by

Re: [f2fs-dev] [PATCH] f2fs-tools: fix overflow bug of start_sector when computing zone_align_start_offset

2018-05-26 Thread Junling Zheng
No neet to change zone_align_start_offset to u64, because zone_align_start_offset is always smaller than zone_size_bytes, which is u32. Thanks, Junling On 2018/5/26 16:09, Yunlong Song wrote: > zone_align_start_offset should be u64, but config.start_sector is u32, > so it may be overflow when co

Re: [f2fs-dev] [PATCH] resize.f2fs: skip cursegs when finding next free block

2018-06-04 Thread Junling Zheng
On 2018/6/5 4:55, Jaegeuk Kim wrote: > On 06/04, Sheng Yong wrote: >> resize.f2fs (f2fs_defragment) tries to migrate blocks to new positions. >> However, if a curseg is selected, and f2fs_defragment is broken by any >> error, curseg->next_blkoff is left not updated. >> >> To avoid this, we skip cur

[f2fs-dev] [PATCH] fsck.f2fs: do not print content beyond sb->version

2018-06-06 Thread Junling Zheng
Currently, versions in f2fs_configuration have one more byte than those in sb, so versions in sb may not end with '\0', and then print_raw_sb_info() will print something beyond sb->version. Signed-off-by: Junling Zheng --- fsck/mount.c | 5 - 1 file changed, 4 insertions(+

Re: [f2fs-dev] [PATCH] fsck.f2fs: do not print content beyond sb->version

2018-06-06 Thread Junling Zheng
Actually, I prefer to fix this bug by unifying the length of versions in f2fs_configuration and f2fs_super_block :) Reference: https://sourceforge.net/p/linux-f2fs/mailman/message/35398537/ Thanks On 2018/6/6 22:39, Junling Zheng wrote: > Currently, versions in f2fs_configuration have one m

[f2fs-dev] [PATCH v2] fsck.f2fs: do not print content beyond sb->version

2018-06-07 Thread Junling Zheng
Currently, versions in f2fs_configuration have one more byte than those in sb, so versions in sb may not end with '\0', and then print_raw_sb_info() will print something beyond sb->version. Signed-off-by: Junling Zheng --- fsck/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

Re: [f2fs-dev] [PATCH] fsck.f2fs: do not print content beyond sb->version

2018-06-07 Thread Junling Zheng
On 2018/6/7 18:53, Chao Yu wrote: > On 2018/6/6 22:39, Junling Zheng wrote: >> Currently, versions in f2fs_configuration have one more byte than >> those in sb, so versions in sb may not end with '\0', and then >> print_raw_sb_info() will print something beyond s

[f2fs-dev] [PATCH] f2fs-tools: fix compile errors on AOSP

2018-06-20 Thread Junling Zheng
Include needed header files directly to fix compile errors on AOSP. Signed-off-by: Junling Zheng --- include/f2fs_fs.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 49ecee9..0a1ed84 100644 --- a/include/f2fs_fs.h +++ b

[f2fs-dev] [PATCH] dump.f2fs: only dump nat inside the specified nid range

2018-06-29 Thread Junling Zheng
Only dump nat info of nids inside the specified range. Signed-off-by: Junling Zheng --- fsck/dump.c | 79 - fsck/fsck.h | 2 +- fsck/main.c | 4 +-- 3 files changed, 38 insertions(+), 47 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c

Re: [f2fs-dev] [PATCH] dump.f2fs: only dump nat inside the specified nid range

2018-07-01 Thread Junling Zheng
Hi, Chao On 2018/7/1 10:22, Chao Yu wrote: > Hi Junling, > > On 2018/6/29 18:11, Junling Zheng wrote: >> Only dump nat info of nids inside the specified range. >> >> Signed-off-by: Junling Zheng >> --- >> fsck/dump.c | 79 --

Re: [f2fs-dev] [PATCH] dump.f2fs: only dump nat inside the specified nid range

2018-07-01 Thread Junling Zheng
On 2018/7/2 10:43, Chao Yu wrote: > Hi Junling, > > On 2018/7/2 10:09, Junling Zheng wrote: >> Hi, Chao >> >> On 2018/7/1 10:22, Chao Yu wrote: >>> Hi Junling, >>> >>> On 2018/6/29 18:11, Junling Zheng wrote: >>>> Only dump na

[f2fs-dev] [PATCH v2] dump.f2fs: only dump nat inside the specified nid range

2018-07-01 Thread Junling Zheng
Only dump nat info of nids inside the specified range. Signed-off-by: Junling Zheng --- v1 -> v2: 1) change {start,end}_nat type into nid_t 2) put ASSERT() sentence close up to malloc 3) use F2FS_NODE_INO and F2FS_META_INO instead of ino 1 and 2 4) update man page of dump.f2fs fsck/dum

[f2fs-dev] [PATCH v3] dump.f2fs: only dump nat inside the specified nid range

2018-07-02 Thread Junling Zheng
Only dump nat info of nids inside the specified range. Signed-off-by: Junling Zheng --- v2 -> v3: 1) add a parameter to current_nat_addr() to get the correct nat pack 2) use current_nat_addr() to get block_addr and nat pack in nat_dump v1 -> v2: 1) change {start,end}_nat type into ni

Re: [f2fs-dev] [PATCH v2] f2fs-tools: set segment_count in super block correctly

2016-02-03 Thread Junling Zheng
On 2016/2/3 13:29, Fan Li wrote: > Now f2fs will check statistics recorded in super block in > sanity_check_area_boundary() during mount,if number of segments per > section is greater than 1, and the disk space isn't aligned with section, Hi Fan, Hi Kim: I'm uncertain about which unit the disk

Re: [f2fs-dev] [PATCH v2] f2fs-tools: set segment_count in super block correctly

2016-02-04 Thread Junling Zheng
On 2016/2/4 17:33, Fan Li wrote: > > >> -Original Message----- >> From: Junling Zheng [mailto:zhengjunl...@huawei.com] >> Sent: Thursday, February 04, 2016 10:52 AM >> To: Fan Li; 'Jaegeuk Kim'; heyun...@huawei.com >> Cc: linux-f2fs-devel@l

[f2fs-dev] [PATCH] mkfs.f2fs: recalculate sit_segments by max_sit_bitmap_size

2016-02-18 Thread Junling Zheng
from segment_count_sit in f2fs_write_check_point_pack() being over MAX_SIT_BITMAP_SIZE. Signed-off-by: Junling Zheng --- mkfs/f2fs_format.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 645c2aa..24b2cc1

Re: [f2fs-dev] [PATCH] mkfs.f2fs: recalculate sit_segments by max_sit_bitmap_size

2016-02-22 Thread Junling Zheng
On 2016/2/23 1:31, Jaegeuk Kim wrote: > Hi Junling, > > On Thu, Feb 18, 2016 at 04:59:04PM +0800, Junling Zheng wrote: >> In most cases, sit_bitmap_size is smaller than MAX_SIT_BITMAP_SIZE. >> >> However, in some extreme scenarios, such as 16TB, sit_bitmap_s

[f2fs-dev] [RFC PATCH v2] mkfs.f2fs: recalculate sit_segments by max_sit_bitmap_size

2016-02-22 Thread Junling Zheng
from segment_count_sit in f2fs_write_check_point_pack() being over MAX_SIT_BITMAP_SIZE. Signed-off-by: Junling Zheng --- mkfs/f2fs_format.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 645c2aa..3a050e0

Re: [f2fs-dev] [RFC PATCH v2] mkfs.f2fs: recalculate sit_segments by max_sit_bitmap_size

2016-02-22 Thread Junling Zheng
On 2016/2/23 13:28, Chao Yu wrote: > Hi all, > >> -Original Message----- >> From: Junling Zheng [mailto:zhengjunl...@huawei.com] >> Sent: Tuesday, February 23, 2016 11:47 AM >> To: linux-f2fs-devel@lists.sourceforge.net; jaeg...@kernel.org >> Subject:

Re: [f2fs-dev] [RFC PATCH v2] mkfs.f2fs: recalculate sit_segments by max_sit_bitmap_size

2016-02-23 Thread Junling Zheng
Hi Chao, On 2016/2/23 17:46, Chao Yu wrote: > Hi Junling, > >> -Original Message----- >> From: Junling Zheng [mailto:zhengjunl...@huawei.com] >> Sent: Tuesday, February 23, 2016 3:20 PM >> To: Chao Yu; jaeg...@kernel.org >> Cc: linux-f2fs-devel@lists.sourc

[f2fs-dev] [RFC PATCH 1/2] libf2fs: limit the total size up to 16T

2016-02-23 Thread Junling Zheng
F2FS can support 16T bytes at most. Limit the config.total_sectors so that most parameters calculated according to it in sb/cp can be limited correctly too. Signed-off-by: Junling Zheng --- lib/libf2fs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/libf2fs.c b/lib/libf2fs.c

[f2fs-dev] [RFC PATCH 2/2] f2fs-tools: redefine MAX_SIT_BITMAP_SIZE

2016-02-23 Thread Junling Zheng
methods and redefine MAX_SIT_BITMAP_SIZE to prevent sit_ver_bitmap_bytesize overflowing. Signed-off-by: Junling Zheng --- include/f2fs_fs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index b58aa74..3a1d2d1 100644 --- a/include

Re: [f2fs-dev] [PATCH v2] f2fs-tools: set segment_count in super block correctly

2016-02-24 Thread Junling Zheng
Hi, Fan, On 2016/2/24 15:57, Fan Li wrote: > > >> -Original Message- >> From: Jaegeuk Kim [mailto:jaeg...@kernel.org] >> Sent: Saturday, February 06, 2016 12:08 PM >> To: Fan Li >> Cc: 'Junling Zheng'; heyun...@huawei.com; >> linux-f2

[f2fs-dev] [RFC PATCH] fsck.f2fs: calculate the total size correctly

2016-02-26 Thread Junling Zheng
Correctly calculate the total FS size in init_sb_info, for sector size may not be 512 bytes. Signed-off-by: Junling Zheng --- fsck/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index 4c807f9..3adaa8a 100644 --- a/fsck/mount.c +++ b/fsck

[f2fs-dev] [RFC PATCH v2] fsck.f2fs: calculate the total size correctly

2016-02-26 Thread Junling Zheng
Correctly calculate the total FS size in init_sb_info(), for sector size may not be 512 bytes. Signed-off-by: Junling Zheng --- fsck/mount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index 4c807f9..7f4b85a 100644 --- a/fsck/mount.c +++ b

Re: [f2fs-dev] [PATCH v2] f2fs-tools: set segment_count in super block correctly

2016-02-29 Thread Junling Zheng
Hi, Fan, On 2016/3/1 13:58, Fan Li wrote: > > >> -Original Message----- >> From: Junling Zheng [mailto:zhengjunl...@huawei.com] >> Sent: Wednesday, February 24, 2016 4:34 PM >> To: Fan Li; 'Jaegeuk Kim' >> Cc: heyun...@huawei.com; linux-f2fs-dev

[f2fs-dev] [PATCH] fsck.f2fs: fix incorrect block_addr of node/meta

2016-03-02 Thread Junling Zheng
Fix incorrect block_addr of node or meta inode into 0x1 during build_nat_area_bitmap(). Signed-off-by: Junling Zheng Signed-off-by: Liu Xue Signed-off-by: Sheng Yong --- fsck/mount.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index

[f2fs-dev] [PATCH v3] mkfs.f2fs: set segment_count in super block correctly

2016-03-15 Thread Junling Zheng
egment_count with zone size as well as segment_count_main to prevent such problem. Signed-off-by: Fan Li Signed-off-by: Junling Zheng --- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 4f38f03..960031e 1006

[f2fs-dev] [PATCH] fsck.f2fs: calculate orphan_blkaddr correctly

2016-03-16 Thread Junling Zheng
Commit 4ea4f1db ("fsck.f2fs: large volume support") added the support for large volume over about 3TB. The "cp_payload" is added to start_blk, but not removed from orphan_blkaddr. Fixes: 4ea4f1db ("fsck.f2fs: large volume support") Signed-off-by: Junling Zheng -

[f2fs-dev] [PATCH] f2fs: remove unused cp_blkaddr in f2fs_sanity_check_ckpt

2018-07-30 Thread Junling Zheng
Remove unused cp_blkaddr in f2fs_sanity_check_ckpt(). Signed-off-by: Junling Zheng --- fs/f2fs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index d56bc6eb8760..6ee003e87f63 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c

Re: [f2fs-dev] [PATCH] f2fs: remove unused cp_blkaddr in f2fs_sanity_check_ckpt

2018-08-01 Thread Junling Zheng
On 2018/8/1 14:54, Chao Yu wrote: > Hi Junling, > > On 2018/7/31 13:21, Junling Zheng wrote: >> Remove unused cp_blkaddr in f2fs_sanity_check_ckpt(). > > Since this issue is introduced by recent change, and the related patch has not > been upstreamed yet, can we merge

[f2fs-dev] [PATCH] fsck.f2fs: supply more check entries for checkpoint

2018-08-02 Thread Junling Zheng
Supply some more check entries for checkpoint in sanity_check_ckpt() and validate_checkpoint() to sync them with kernel. Signed-off-by: Junling Zheng --- fsck/mount.c | 69 +-- include/f2fs_fs.h | 1 + 2 files changed, 68 insertions(+), 2

[f2fs-dev] [RFC PATCH 2/3] f2fs-tools: rename CHECKSUM_OFFSET to CHKSUM_OFFSET_CP

2018-08-07 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CHKSUM_OFFSET_CP. Signed-off-by: Junling Zheng --- fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_format.c | 14 +++--- 5 files changed, 18 insertions(+), 18

[f2fs-dev] [RFC PATCH] f2fs: support superblock checksum

2018-08-07 Thread Junling Zheng
Now we support crc32 checksum for superblock. Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 28 include/linux/f2fs_fs.h | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs

[f2fs-dev] [RFC PATCH 3/3] f2fs-tools: introduce sb checksum

2018-08-07 Thread Junling Zheng
This patch introduced superblock checksum. Signed-off-by: Junling Zheng --- fsck/mount.c | 52 ++ fsck/resize.c | 11 ++ include/f2fs_fs.h | 6 +- mkfs/f2fs_format.c | 9 4 files changed, 77 insertions(+), 1 deletion

[f2fs-dev] [RFC PATCH v2 1/3] f2fs: support superblock checksum

2018-08-07 Thread Junling Zheng
Now we support crc32 checksum for superblock. Signed-off-by: Junling Zheng --- v1 -> v1: - fix to switch endian of crc. fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 28 include/linux/f2fs_fs.h | 3 ++- 3 files changed, 31 insertions(+), 1 delet

[f2fs-dev] [RFC PATCH v2 2/3] f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET

2018-08-08 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET. Signed-off-by: Junling Zheng --- v1 -> v2: - Rename CHKSUM_OFFSET_CP to CP_CHKSUM_OFFSET. fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_forma

[f2fs-dev] [RFC PATCH v3 1/3] f2fs: support superblock checksum

2018-08-08 Thread Junling Zheng
Now we support crc32 checksum for superblock. Signed-off-by: Junling Zheng --- v2 -> v3: - add sysfs entry for superblock checksum. - move the crc checking to the beginning of sanity_check_raw_super(). - fix the NULL pointer dereference as sb->s_fs_info hasn't be

[f2fs-dev] [RFC PATCH v2 3/3] f2fs-tools: introduce sb checksum

2018-08-08 Thread Junling Zheng
This patch introduced superblock checksum. Signed-off-by: Junling Zheng --- v1 -> v2: - Rename CHKSUM_OFFSET_SB to SB_CHKSUM_OFFSET. - Introduce update_sb_chksum() to update superblock checksum. fsck/fsck.h| 1 + fsck/mount.c |

Re: [f2fs-dev] [RFC PATCH v3 1/3] f2fs: support superblock checksum

2018-08-08 Thread Junling Zheng
On 2018/8/8 20:03, Chao Yu wrote: > On 2018/8/8 18:27, Junling Zheng wrote: >> Now we support crc32 checksum for superblock. >> >> Signed-off-by: Junling Zheng >> --- >> v2 -> v3: >> - add sysfs entry for superblock checksum. >> - move the crc che

Re: [f2fs-dev] [RFC PATCH v3 1/3] f2fs: support superblock checksum

2018-08-08 Thread Junling Zheng
On 2018/8/8 20:24, Chao Yu wrote: > On 2018/8/8 20:21, Junling Zheng wrote: >> On 2018/8/8 20:03, Chao Yu wrote: >>> On 2018/8/8 18:27, Junling Zheng wrote: >>>> Now we support crc32 checksum for superblock. >>>> >>>> Signed-off-by: Junling

[f2fs-dev] [RFC PATCH v4 1/3] f2fs: support superblock checksum

2018-08-08 Thread Junling Zheng
Now we support crc32 checksum for superblock. Signed-off-by: Junling Zheng --- v3 -> v4: - use '%zu' for size_t to fix compile warning. - use f2fs_sb_has_sb_chksum() instead of F2FS_HAS_FEATURE(). v2 -> v3: - add sysfs entry for superblock checksum. - move the crc checking

[f2fs-dev] [RFC PATCH 4/4] f2fs-tools: introduce sb checksum

2018-08-13 Thread Junling Zheng
This patch introduced crc for superblock. Signed-off-by: Junling Zheng --- fsck/mount.c | 23 +++ fsck/resize.c | 12 ++-- include/f2fs_fs.h | 16 +++- mkfs/f2fs_format.c | 3 +++ 4 files changed, 47 insertions(+), 7 deletions(-) diff --git

[f2fs-dev] [RFC PATCH RESEND 1/4] f2fs: support superblock checksum

2018-08-13 Thread Junling Zheng
Now we support crc32 checksum for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 29 + fs/f2fs/sysfs.c | 7 +++ include/linux/f2fs_fs.h | 3 ++- 4 files changed, 40

[f2fs-dev] [RFC PATCH RESEND 2/4] f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET

2018-08-13 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_format.c | 14 +++--- 5 files changed

[f2fs-dev] [RFC PATCH 3/4] f2fs-tools: unify the writeback of superblock

2018-08-13 Thread Junling Zheng
Introduce __write_superblock() to support updating specified one superblock or both, thus we can wrapper it in update_superblock() and f2fs_write_super_block to unify all places where sb needs to be updated. Signed-off-by: Junling Zheng --- fsck/fsck.h| 2 +- fsck/mount.c | 74

Re: [f2fs-dev] [RFC PATCH 4/4] f2fs-tools: introduce sb checksum

2018-08-13 Thread Junling Zheng
Hi, Chao On 2018/8/13 22:33, Chao Yu wrote: > On 2018/8/13 21:32, Junling Zheng wrote: >> This patch introduced crc for superblock. >> >> Signed-off-by: Junling Zheng >> --- >> fsck/mount.c | 23 +++ >> fsck/resize.c | 12 +

Re: [f2fs-dev] [RFC PATCH 3/4] f2fs-tools: unify the writeback of superblock

2018-08-13 Thread Junling Zheng
On 2018/8/13 22:25, Chao Yu wrote: > On 2018/8/13 21:32, Junling Zheng wrote: >> Introduce __write_superblock() to support updating specified one >> superblock or both, thus we can wrapper it in update_superblock() and >> f2fs_write_super_block to unify all places where s

[f2fs-dev] [RFC PATCH RESEND 4/4] f2fs-tools: introduce sb checksum

2018-08-13 Thread Junling Zheng
This patch introduced crc for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/mount.c | 23 +++ fsck/resize.c | 12 ++-- include/f2fs_fs.h | 16 +++- mkfs/f2fs_format.c | 3 +++ 4 files changed, 47 insertions(+), 7

[f2fs-dev] [RFC PATCH v2 3/4] f2fs-tools: unify the writeback of superblock

2018-08-13 Thread Junling Zheng
Introduce __write_superblock() to support updating specified one superblock or both, thus we can wrapper it in update_superblock() and f2fs_write_super_block to unify all places where sb needs to be updated. Signed-off-by: Junling Zheng --- v1 -> v2: - if dev_write_block failed, add some no

[f2fs-dev] [RFC PATCH RESEND 1/4] f2fs: support superblock checksum

2018-08-13 Thread Junling Zheng
Now we support crc32 checksum for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 29 + fs/f2fs/sysfs.c | 7 +++ include/linux/f2fs_fs.h | 3 ++- 4 files changed, 40

[f2fs-dev] [RFC PATCH RESEND 2/4] f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET

2018-08-13 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_format.c | 14 +++--- 5 files changed

Re: [f2fs-dev] [RFC PATCH RESEND 1/4] f2fs: support superblock checksum

2018-08-27 Thread Junling Zheng
Ping... On 2018/8/14 14:56, Junling Zheng wrote: > Now we support crc32 checksum for superblock. > > Reviewed-by: Chao Yu > Signed-off-by: Junling Zheng > --- > fs/f2fs/f2fs.h | 2 ++ > fs/f2fs/super.c | 29 + > fs/f

Re: [f2fs-dev] [RFC PATCH v2 3/4] f2fs-tools: unify the writeback of superblock

2018-08-28 Thread Junling Zheng
On 2018/8/28 21:47, Chao Yu wrote: > On 2018/8/14 14:56, Junling Zheng wrote: >> Introduce __write_superblock() to support updating specified one >> superblock or both, thus we can wrapper it in update_superblock() and >> f2fs_write_super_block to unify all places where s

Re: [f2fs-dev] [PATCH] fsck.f2fs: try to recover cp_payload from valid cp pack

2018-08-29 Thread Junling Zheng
Hi, Jaegeuk On 2018/8/30 10:10, Jaegeuk Kim wrote: > Hi Chao, > > Could you please add this into Junling's patch series? > A little bit confusing between patches and reviews on them. > I'll send an new version patch series with this patch as soon as possible :) > Thanks, > > On 08/28, Chao Yu

[f2fs-dev] [RFC PATCH v3 3/5] f2fs-tools: unify the writeback of superblock

2018-08-29 Thread Junling Zheng
Introduce __write_superblock() to support updating specified one superblock or both, thus we can wrapper it in update_superblock() and f2fs_write_super_block to unify all places where sb needs to be updated. Signed-off-by: Junling Zheng --- v2 -> v3: - fix wrong condition of ASSERT

[f2fs-dev] [RFC PATCH RESEND 1/5] f2fs: support superblock checksum

2018-08-29 Thread Junling Zheng
Now we support crc32 checksum for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 29 + fs/f2fs/sysfs.c | 7 +++ include/linux/f2fs_fs.h | 3 ++- 4 files changed, 40

[f2fs-dev] [RFC PATCH RESEND 5/5] fsck.f2fs: try to recover cp_payload from valid cp pack

2018-08-29 Thread Junling Zheng
From: Chao Yu If sb checksum is not enabled, and cp pack is valid due to no crc inconsistence, let's try to recover cp_payload based on cp_pack_start_sum in cp pack. Signed-off-by: Chao Yu --- fsck/f2fs.h | 5 + fsck/mount.c | 10 +++--- 2 files changed, 12 insertions(+), 3 deletions

[f2fs-dev] [RFC PATCH RESEND 4/5] f2fs-tools: introduce sb checksum

2018-08-29 Thread Junling Zheng
This patch introduced crc for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/mount.c | 23 +++ fsck/resize.c | 12 ++-- include/f2fs_fs.h | 16 +++- mkfs/f2fs_format.c | 3 +++ 4 files changed, 47 insertions(+), 7

[f2fs-dev] [RFC PATCH RESEND 2/5] f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET

2018-08-29 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_format.c | 14 +++--- 5 files changed

Re: [f2fs-dev] [RFC PATCH v3 3/5] f2fs-tools: unify the writeback of superblock

2018-09-10 Thread Junling Zheng
On 2018/9/8 6:23, Jaegeuk Kim wrote: > On 08/30, Junling Zheng wrote: >> Introduce __write_superblock() to support updating specified one >> superblock or both, thus we can wrapper it in update_superblock() and >> f2fs_write_super_block to unify all places where s

Re: [f2fs-dev] [RFC PATCH v3 3/5] f2fs-tools: unify the writeback of superblock

2018-09-10 Thread Junling Zheng
Hi, Jaegeuk On 2018/9/11 10:43, Junling Zheng wrote: > On 2018/9/8 6:23, Jaegeuk Kim wrote: >> On 08/30, Junling Zheng wrote: >>> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h >>> index 38a0da4..df46950 100644 >>> --- a/include/f2fs_fs.h >>> ++

[f2fs-dev] [PATCH 3/5] fsck.f2fs: unify the updating of superblocks

2018-09-19 Thread Junling Zheng
Rename write_superblock() to update_superblock() and make it support updating specified one superblock or both two superblocks, then unify all places where sb needs to be updated. Signed-off-by: Junling Zheng --- fsck/fsck.h | 12 ++- fsck/mount.c | 94

[f2fs-dev] [PATCH 4/5] f2fs-tools: introduce sb checksum

2018-09-19 Thread Junling Zheng
This patch introduced crc for superblock. Signed-off-by: Junling Zheng --- fsck/mount.c | 33 + fsck/resize.c | 12 ++-- include/f2fs_fs.h | 6 +- mkfs/f2fs_format.c | 8 4 files changed, 52 insertions(+), 7 deletions(-) diff

[f2fs-dev] [PATCH 1/5] f2fs: support superblock checksum

2018-09-19 Thread Junling Zheng
Now we support crc32 checksum for superblock. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c | 29 + fs/f2fs/sysfs.c | 7 +++ include/linux/f2fs_fs.h | 3 ++- 4 files changed, 40

[f2fs-dev] [PATCH 5/5] fsck.f2fs: try to recover cp_payload from valid cp pack

2018-09-19 Thread Junling Zheng
From: Chao Yu If sb checksum is not enabled, and cp pack is valid due to no crc inconsistence, let's try to recover cp_payload based on cp_pack_start_sum in cp pack. Signed-off-by: Chao Yu --- fsck/f2fs.h | 5 + fsck/mount.c | 10 +++--- 2 files changed, 12 insertions(+), 3 deletions

[f2fs-dev] [PATCH 2/5] f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET

2018-09-19 Thread Junling Zheng
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET. Reviewed-by: Chao Yu Signed-off-by: Junling Zheng --- fsck/fsck.c| 4 ++-- fsck/mount.c | 4 ++-- fsck/resize.c | 8 include/f2fs_fs.h | 6 +++--- mkfs/f2fs_format.c | 14 +++--- 5 files changed

Re: [f2fs-dev] [PATCH 4/5] f2fs-tools: introduce sb checksum

2018-09-19 Thread Junling Zheng
Hi, Jaegeuk On 2018/9/20 7:35, Jaegeuk Kim wrote: > On 09/19, Junling Zheng wrote: >> This patch introduced crc for superblock. >> >> Signed-off-by: Junling Zheng >> --- >> fsck/mount.c | 33 + >> fsck/resize.c

Re: [f2fs-dev] [PATCH 5/5] fsck.f2fs: try to recover cp_payload from valid cp pack

2018-09-19 Thread Junling Zheng
On 2018/9/20 7:38, Jaegeuk Kim wrote: > On 09/19, Junling Zheng wrote: >> From: Chao Yu >> >> If sb checksum is not enabled, and cp pack is valid due to no >> crc inconsistence, let's try to recover cp_payload based on >> cp_pack_start_sum in cp pack. >>

Re: [f2fs-dev] [PATCH 4/5] f2fs-tools: introduce sb checksum

2018-09-20 Thread Junling Zheng
On 2018/9/21 5:38, Jaegeuk Kim wrote: > On 09/20, Junling Zheng wrote: >> Hi, Jaegeuk >> >> On 2018/9/20 7:35, Jaegeuk Kim wrote: >>> On 09/19, Junling Zheng wrote: >>>> This patch introduced crc for superblock. >>>> >>>> Si

Re: [f2fs-dev] [PATCH 4/5] f2fs-tools: introduce sb checksum

2018-09-25 Thread Junling Zheng
Hi, Jaegeuk On 2018/9/26 9:57, Jaegeuk Kim wrote: > On 09/21, Junling Zheng wrote: >> On 2018/9/21 5:38, Jaegeuk Kim wrote: >>> On 09/20, Junling Zheng wrote: >>>> Hi, Jaegeuk >>>> >>>> On 2018/9/20 7:35, Jaegeuk Kim wrote: >>>>>

  1   2   >