Re: [f2fs-dev] [PATCH] f2fs-tools: add the max chunk size limit in sparse image

2018-10-30 Thread Junling Zheng
Hi, Jaegeuk, Chao, Ming On 2018/10/15 21:24, Gao Ming wrote: > Malloc Failure occurs in 32bit Windows, when using fastboot.exe flash the > f2fs sparse image filling with up to 2G chunk size. > > Signed-off-by: Gao Ming > --- > lib/libf2fs_io.c | 7 +++ > 1 file changed, 7 insertions(+) >

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

2018-09-28 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 --- Change log from v1: - Rename enum SB_ADDR members and define SB_MASK(i). fsck

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

2018-09-28 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] [PATCH 4/5] f2fs-tools: introduce sb checksum

2018-09-28 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-28 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-28 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

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

2018-09-26 Thread Junling Zheng
On 2018/9/27 4:27, Jaegeuk Kim wrote: > On 09/26, Junling Zheng wrote: >> 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

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: >>>>

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 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-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

[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

[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

[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 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

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 >>> ++

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

[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

[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

[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 ASS

[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

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

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] [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

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

2018-08-14 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-14 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 v2 3/4] f2fs-tools: unify the writeback of superblock

2018-08-14 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 4/4] f2fs-tools: introduce sb checksum

2018-08-14 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

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

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 +

[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

[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 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 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 to the beg

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

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

[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 |

[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 s

[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 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] 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 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] [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

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 me

[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

[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

[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

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

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 --

[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

[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

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 sb->v

[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 deletion(-) d

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] 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(+), 1 delet

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

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

[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 <zhengjunl...@huawei.com> --- 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/

[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 <zhengjunl...@huawei.com> --- fsck/mount.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fsck/mount.c

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:

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

[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 <zhengjunl...@huawei.com> Signed-off-by: Sheng Yong <shengyo...@huawei.com> --- fsck/sload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/sload.c b/fsck/sload.c i

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 <zhengjunl...@huawei.com> > --- &

[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 <zhengjunl...@huawei.com> --- fsck/Makefile.am | 3 ++- fsck/fsck.h | 5 + fsck/main.c

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

[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 <zhengjunl...@huawei.com> Reviewed-by: Chao Yu <yuch...@huawei.com> --- Changes from v1: - free

[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 <zhengjunl...@huawei.com> --- Changes from v1: - free buf to fix memory leak. mk

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 su

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

[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 <zhengjunl...@huawei.com> --- mkfs/f2fs_format_main.c | 30 +++--- 1 file ch

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 <ka...@xiaomi.com&

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

[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 <zhengjunl...@huawei.com> --- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[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 <zhengjunl...@huawei.com> --- Changes from v1: - specify the sector size criterion in man page - replace "Warning" with "Info" while wante

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 <zhengjunl...@huawei.com > <mailto:zhengjunl...@huawei.com>> wrote: > > Use 512 bytes as the sector size criterion while specifying the >

[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 <zhengjunl...@huawei.com> --- lib/libf2fs.c | 11 --- mkfs/f2fs_format_main.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff

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

[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 <zhengjunl...@huawei.com> --- fsck/fsck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fsck/fsck.c b/fsck/fsck.c index bc91839..91c8529

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

2018-02-28 Thread Junling Zheng
neric/342 will pass, but the performance will regress. Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- 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 - Se

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

2018-02-13 Thread Junling Zheng
l pass, but the performance will regress. Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- Changes from v2: - Change to "fsync={posix,strict}" format - Set "fsync=posix" default Changes from v1: - Add document modify - Add reviewer Documentation/filesyst

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] 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 <zhengjunl...@huawei.com> --- 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/

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

2018-02-02 Thread Junling Zheng
ot;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 <zhengjunl...@huawe

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

2018-02-01 Thread Junling Zheng
ot;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 <zhengjunl...@huaw

[f2fs-dev] [PATCH v2] resize.f2fs: fix the number of moved ssa blocks in migrate_ssa

2016-11-29 Thread Junling Zheng
, and the expanded summary, which is filled with zero_blocks, should start from: new_sum_blkaddr + TOTAL_SEGS(sbi) - offset. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- fsck/resize.c | 25 ++--- 1 file changed, 1

Re: [f2fs-dev] [PATCH] resize.f2fs: fix an error in migrate_ssa

2016-11-29 Thread Junling Zheng
Ping ... On 2016/11/25 11:53, Junling Zheng wrote: > Sorry, I forget to get the return value of dev_write_block :( > Please review the following patch :) > > --- > fsck/resize.c | 25 ++--- > 1 file changed, 14 insertions(+), 11 deletions(-) > > diff

[f2fs-dev] [PATCH] resize.f2fs: correct the max segno in migrate_main

2016-11-27 Thread Junling Zheng
Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- fsck/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/resize.c b/fsck/resize.c index 46aa30e..ba7bb88 100644 --- a/fsck/resize.c +++ b/fsck/resize.c @@ -143,7 +143,7 @@ static void migrate_main(

Re: [f2fs-dev] [PATCH] resize.f2fs: fix an error in migrate_ssa

2016-11-24 Thread Junling Zheng
ASSERT(ret >=0); + } else - move_ssa(sbi, offset--, blkaddr); - blkaddr--; + move_ssa(sbi, offset--, blkaddr--); } } On 2016/11/2

Re: [f2fs-dev] [PATCH] resize.f2fs: fix an error in migrate_ssa

2016-11-24 Thread Junling Zheng
How about the following patch, which I think would be a little better :) diff --git a/fsck/resize.c b/fsck/resize.c index 46aa30e..c295a06 100644 --- a/fsck/resize.c +++ b/fsck/resize.c @@ -207,30 +207,33 @@ static void migrate_ssa(struct f2fs_sb_info *sbi, block_t old_sum_blkaddr =

[f2fs-dev] [PATCH] fsck: refactor build_nat_area_bitmap to speed up fsck

2016-11-07 Thread Junling Zheng
-p 1", it reduces over half of the time. Empty Fragmented Entirely 32G(ms): original 625.8 727.3 improved 226.3 298.2 64G(ms): original 11591637.7 improved 515.8 676.7 Signed-off-by: Junling Zheng

[f2fs-dev] [PATCH 3/4] fsck.f2fs: fix a typo in check_sector_size

2016-09-29 Thread Junling Zheng
Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- fsck/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index a247dec..5f51009 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1908,7 +1908,7 @@ static int check_sector_size(

[f2fs-dev] [PATCH 2/4] fsck.f2fs: fix incorrect ERR_MSG in f2fs_do_mount

2016-09-29 Thread Junling Zheng
Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- fsck/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index e390b26..a247dec 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1978,7 +1978,7 @@ int f2fs_do_mount(struct f2fs_s

[f2fs-dev] [PATCH] fsck.f2fs: remove duplicated codes in sanity_check_raw_super

2016-04-25 Thread Junling Zheng
Remove duplicated codes in sanity_check_raw_super(). Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- fsck/mount.c | 4 1 file changed, 4 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 4bde179..f866c4f 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -376,10

[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 <z

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

2016-03-15 Thread Junling Zheng
count. Here align segment_count with zone size as well as segment_count_main to prevent such problem. Signed-off-by: Fan Li <fanofcode...@samsung.com> Signed-off-by: Junling Zheng <zhengjunl...@huawei.com> --- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) d

[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 <zhengjunl...@huawei.com> Signed-off-by: Liu Xue <liuxueliu@huawei.com> Signed-off-by: Sheng Yong <shengyo...@huawei.com> --- fsck/mount.c | 9 -

  1   2   >