[f2fs-dev] [PATCH 1/4] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-08-19 Thread Shin'ichiro Kawasaki
t for each zone. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 57 + 2 files changed, 59 insertions(+) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 84f3f3e..7d2cdda 100644 --- a/include/

[f2fs-dev] [PATCH 4/4] fsck.f2fs: Check write pointer consistency with valid blocks count

2019-08-19 Thread Shin'ichiro Kawasaki
e zone has no valid blocks. Signed-off-by: Shin'ichiro Kawasaki --- fsck/fsck.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 6beac5a..14bc804 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2622,6 +2622,

[f2fs-dev] [PATCH 2/4] libf2fs_zoned: Introduce f2fs_reset_zone() function

2019-08-19 Thread Shin'ichiro Kawasaki
To allow fsck to reset a zone with inconsistent write pointer, introduce a helper function f2fs_reset_zone(). Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 1 + lib/libf2fs_zoned.c | 24 2 files changed, 25 insertions(+) diff --git a/include/f2fs

[f2fs-dev] [PATCH 3/4] fsck.f2fs: Check write pointer consistency with current segments

2019-08-19 Thread Shin'ichiro Kawasaki
'force' flag in fsck_verify() to enforce fixes in following checks. This position fix is done at the beginning of do_fsck() function so that other checks reflect the current segment modification. Signed-off-by: Shin'ichiro Kawasaki --- fsck/fsck.c | 133 +++

[f2fs-dev] [PATCH 0/4] fsck: Check write pointers of zoned block devices

2019-08-19 Thread Shin'ichiro Kawasaki
es depends on other patches for zoned block devices, then it conflicts with the master branch in f2fs-tools.git as of Aug/19/2019. It can be applied without conflict to dev and dev-test branch tips. Shin'ichiro Kawasaki (4): libf2fs_zoned: Introduce f2fs_report_zones() helper function

[f2fs-dev] [PATCH v2 4/4] fsck.f2fs: Check write pointer consistency with valid blocks count

2019-08-20 Thread Shin'ichiro Kawasaki
e zone has no valid blocks. Signed-off-by: Shin'ichiro Kawasaki --- fsck/fsck.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 21a06ac..cc9bbc0 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2595,6 +2595,

[f2fs-dev] [PATCH v2 2/4] libf2fs_zoned: Introduce f2fs_reset_zone() function

2019-08-20 Thread Shin'ichiro Kawasaki
To allow fsck to reset a zone with inconsistent write pointer, introduce a helper function f2fs_reset_zone(). Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 1 + lib/libf2fs_zoned.c | 24 2 files changed, 25 insertions(+) diff --git a/include/f2fs

[f2fs-dev] [PATCH v2 1/4] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-08-20 Thread Shin'ichiro Kawasaki
t for each zone. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 57 + 2 files changed, 59 insertions(+) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 0d9a036..abadd1b 100644 --- a/include/

[f2fs-dev] [PATCH v2 0/4] fsck: Check write pointers of zoned block devices

2019-08-20 Thread Shin'ichiro Kawasaki
es depends on other patches for zoned block devices, then it conflicts with the master branch in f2fs-tools.git as of Aug/19/2019. It can be applied without conflict to dev and dev-test branch tips. Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (4): libf2fs_z

[f2fs-dev] [PATCH v2 3/4] fsck.f2fs: Check write pointer consistency with current segments

2019-08-20 Thread Shin'ichiro Kawasaki
'force' flag in fsck_verify() to enforce fixes in following checks. This position fix is done at the beginning of do_fsck() function so that other checks reflect the current segment modification. Signed-off-by: Shin'ichiro Kawasaki --- fsck/fsck.c | 133 +++

[f2fs-dev] [PATCH v3 0/2] fsck: Check write pointers of zoned block devices

2019-08-28 Thread Shin'ichiro Kawasaki
es from v2: * Reflected review comments by Chao Yu * Dropped 4th patch and 2nd patch (2nd patch was required for the 4th patch) Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (2): libf2fs_zoned: Introduce f2fs_report_zones() helper function fsck.f2fs: Check write poin

[f2fs-dev] [PATCH v3 1/2] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-08-28 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 5 lib/libf2fs_zoned.c | 59 + 2 files changed, 64 inse

[f2fs-dev] [PATCH v3 2/2] fsck.f2fs: Check write pointer consistency with current segments

2019-08-28 Thread Shin'ichiro Kawasaki
'force' flag in fsck_verify() to enforce fixes in following checks. This position fix is done at the beginning of do_fsck() function so that other checks reflect the current segment modification. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: C

[f2fs-dev] [PATCH v4 0/2] fsck: Check write pointers of zoned block devices

2019-08-30 Thread Shin'ichiro Kawasaki
v3: * Set curseg position at a new zone start when its write pointer is at zone end Changes from v2: * Reflected review comments by Chao Yu * Dropped 4th patch and 2nd patch (2nd patch was required for the 4th patch) Changes from v1: * Fixed build failure on dev branch Shin'ich

[f2fs-dev] [PATCH v4 1/2] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-08-30 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- include/f2fs_fs.h | 5 lib/libf2fs_zoned.c | 59 +

[f2fs-dev] [PATCH v4 2/2] fsck.f2fs: Check write pointer consistency with current segments

2019-08-30 Thread Shin'ichiro Kawasaki
t modification. Also add GET_SEC_FROM_SEG and GET_SEG_FROM_SEC macros in fsck/fsck.h to simplify the code. Signed-off-by: Shin'ichiro Kawasaki --- fsck/f2fs.h | 5 ++ fsck/fsck.c | 198 fsck/fsck.h | 3 + fsck/main.c | 2 + 4 files ch

[f2fs-dev] [PATCH 2/2] f2fs: Check write pointer consistency of non-open zones

2019-10-17 Thread Shin'ichiro Kawasaki
zone, because the zone is not selected for next write operation until the zone get discarded. Also move a constant F2FS_REPORT_ZONE from super.c to f2fs.h to use it in segment.c also. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 3 + fs/f2fs/segme

[f2fs-dev] [PATCH 1/2] f2fs: Check write pointer consistency of open zones

2019-10-17 Thread Shin'ichiro Kawasaki
positions. The second check is done at end of f2fs_fill_super() to make sure the write pointer consistency regardless of fsync data recovery execution. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 6 +++ fs/f2fs/s

[f2fs-dev] [PATCH 0/2] f2fs: Check write pointers of zoned block devices

2019-10-17 Thread Shin'ichiro Kawasaki
o run fsck. Corresponding patch series is being posted for fsck.f2fs to add the write pointer consistency check feature. Thank goes to Chao Yu for the detailed discussion on the list. Shin'ichiro Kawasaki (2): f2fs: Check write pointer consistency of open zones f2fs: Check write pointer con

[f2fs-dev] [PATCH v5 7/8] fsck: Check write pointer consistency of open zones

2019-10-17 Thread Shin'ichiro Kawasaki
hat other fixes can reflect the current segment modification. The second is done in fsck_verify() to reflect updated meta data by other fixes. Signed-off-by: Shin'ichiro Kawasaki --- fsck/f2fs.h | 5 ++ fsck/fsck.c | 154 +++ fsck/fsck.h |

[f2fs-dev] [PATCH v5 2/8] libf2fs_zoned: Introduce f2fs_report_zone() helper function

2019-10-17 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency check by fsck, add f2fs_report_zone() helper function which calls REPORT ZONE command to get write pointer status of a single zone. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'i

[f2fs-dev] [PATCH v5 0/8] fsck: Check write pointers of zoned block devices

2019-10-18 Thread Shin'ichiro Kawasaki
sition at a new zone start when its write pointer is at zone end Changes from v2: * Reflected review comments by Chao Yu * Dropped 4th patch and 2nd patch (2nd patch was required for the 4th patch) Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (8): libf

[f2fs-dev] [PATCH v5 4/8] fsck: Find free zones instead of blocks to assign to current segments

2019-10-18 Thread Shin'ichiro Kawasaki
block devices. Also skip relocate_curseg_offset() for the devices with ZONED_HM model for the same reason. Signed-off-by: Shin'ichiro Kawasaki --- fsck/defrag.c | 2 +- fsck/fsck.h| 2 +- fsck/mount.c | 12 fsck/segment.c | 2 +- 4 files changed, 11 insertions(+), 7 d

[f2fs-dev] [PATCH v5 3/8] libf2fs_zoned: Introduce f2fs_reset_zone() helper function

2019-10-18 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency fix by fsck, add f2fs_reset_zone() helper function which calls RESET ZONE command. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 1 +

[f2fs-dev] [PATCH v5 6/8] fsck: Check fsync data always for zoned block devices

2019-10-18 Thread Shin'ichiro Kawasaki
fsck needs fsync data check or not. For zoned block devices, always return true. Otherwise, return true if UMOUNT flag is not set in CP. Replace UMOUNT flag check codes for fsync data with the function call. Signed-off-by: Shin'ichiro Kawasaki --- fsck/fsck.h| 6 ++ fsck/mount.c

[f2fs-dev] [PATCH v5 1/8] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-10-18 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 5 lib/libf2fs_zoned.c | 59 + 2 files changed, 64 inse

[f2fs-dev] [PATCH v5 8/8] fsck: Check write pointer consistency of non-open zones

2019-10-18 Thread Shin'ichiro Kawasaki
the zone get discarded. In the same manner as the consistency check for current segments, do the check and fix twice: at the beginning of do_fsck() to avoid unaligned write error during fsck, and at fsck_verify() to reflect meta data updates by fsck. Signed-off-by: Shin'ichiro Kawasaki ---

[f2fs-dev] [PATCH v5 5/8] fsck: Introduce move_one_curseg_info() function

2019-10-18 Thread Shin'ichiro Kawasaki
: Shin'ichiro Kawasaki --- fsck/mount.c | 68 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 8d2ba55..915f487 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2532,52 +2532,58 @@ int find_next_free_

[f2fs-dev] [PATCH v6 7/8] fsck: Check write pointer consistency of open zones

2019-10-27 Thread Shin'ichiro Kawasaki
hat other fixes can reflect the current segment modification. The second is done in fsck_verify() to reflect updated meta data by other fixes. Signed-off-by: Shin'ichiro Kawasaki --- fsck/f2fs.h | 5 ++ fsck/fsck.c | 154 +++ fsck/fsck.h |

[f2fs-dev] [PATCH v6 5/8] fsck: Introduce move_one_curseg_info() function

2019-10-27 Thread Shin'ichiro Kawasaki
: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- fsck/mount.c | 68 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 8d2ba55..915f487 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2532,52 +2532,58 @

[f2fs-dev] [PATCH v6 4/8] fsck: Find free zones instead of blocks to assign to current segments

2019-10-27 Thread Shin'ichiro Kawasaki
block devices. Also skip relocate_curseg_offset() for the devices with ZONED_HM model for the same reason. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- fsck/defrag.c | 2 +- fsck/fsck.h| 2 +- fsck/mount.c | 12 fsck/segment.c | 2 +- 4 files cha

[f2fs-dev] [PATCH v6 8/8] fsck: Check write pointer consistency of non-open zones

2019-10-27 Thread Shin'ichiro Kawasaki
the zone get discarded. In the same manner as the consistency check for current segments, do the check and fix twice: at the beginning of do_fsck() to avoid unaligned write error during fsck, and at fsck_verify() to reflect meta data updates by fsck. Signed-off-by: Shin'ichiro Kawasaki ---

[f2fs-dev] [PATCH v6 6/8] fsck: Check fsync data always for zoned block devices

2019-10-27 Thread Shin'ichiro Kawasaki
fsck needs fsync data check or not. For zoned block devices, always return true. Otherwise, return true if UMOUNT flag is not set in CP. Replace UMOUNT flag check codes for fsync data with the function call. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- fsck/fsck.h

[f2fs-dev] [PATCH v2 1/2] f2fs: Check write pointer consistency of open zones

2019-10-27 Thread Shin'ichiro Kawasaki
positions. The second check is done at end of f2fs_fill_super() to make sure the write pointer consistency regardless of fsync data recovery execution. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 6 +++ fs/f2fs/s

[f2fs-dev] [PATCH v2 2/2] f2fs: Check write pointer consistency of non-open zones

2019-10-27 Thread Shin'ichiro Kawasaki
zone, because the zone is not selected for next write operation until the zone get discarded. Also move a constant F2FS_REPORT_ZONE from super.c to f2fs.h to use it in segment.c also. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 3 + fs/f2fs/segme

[f2fs-dev] [PATCH v2 0/2] f2fs: Check write pointers of zoned block devices

2019-10-27 Thread Shin'ichiro Kawasaki
o run fsck. Corresponding patch series is being posted for fsck.f2fs to add the write pointer consistency check feature. Thank goes to Chao Yu for the detailed discussion on the list. Changes from v1: * 2nd patch: Added check to ensure zones are in main segments Shin'ichiro Kawasaki (2): f2

[f2fs-dev] [PATCH v6 3/8] libf2fs_zoned: Introduce f2fs_reset_zone() helper function

2019-10-28 Thread Shin'ichiro Kawasaki
function f2fs_reset_zone() prints an error message as other helper functions in lib/libf2fs_zoned print. To make the message consistent through the all helper functions, modify message strings in f2fs_check_zones() and f2fs_reset_zones(). Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h

[f2fs-dev] [PATCH v6 0/8] fsck: Check write pointers of zoned block devices

2019-10-28 Thread Shin'ichiro Kawasaki
atch (2nd patch was required for the 4th patch) Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (8): libf2fs_zoned: Introduce f2fs_report_zones() helper function libf2fs_zoned: Introduce f2fs_report_zone() helper function libf2fs_zoned: Introduce f2fs_reset_zo

[f2fs-dev] [PATCH v6 1/8] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-10-28 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki --- include/f2fs_fs.h | 5 lib/libf2fs_zoned.c | 59 + 2 files changed, 64 inse

[f2fs-dev] [PATCH v6 2/8] libf2fs_zoned: Introduce f2fs_report_zone() helper function

2019-10-28 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency check by fsck, add f2fs_report_zone() helper function which calls REPORT ZONE command to get write pointer status of a single zone. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'i

[f2fs-dev] [PATCH v7 7/8] fsck: Check write pointer consistency of open zones

2019-11-13 Thread Shin'ichiro Kawasaki
ther fixes can reflect the current segment modification. The second is done in fsck_verify() to reflect updated meta data by other fixes. Signed-off-by: Shin'ichiro Kawasaki --- fsck/f2fs.h | 5 ++ fsck/fsck.c | 152 +++ fsck/fsck.h | 3

[f2fs-dev] [PATCH v7 5/8] fsck: Introduce move_one_curseg_info() function

2019-11-13 Thread Shin'ichiro Kawasaki
: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/mount.c | 68 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 7ce885c..cd6b51b 100644 --- a/fsck/mount.c +++ b/fsck/mo

[f2fs-dev] [PATCH v7 3/8] libf2fs_zoned: Introduce f2fs_reset_zone() helper function

2019-11-13 Thread Shin'ichiro Kawasaki
function f2fs_reset_zone() prints an error message as other helper functions in lib/libf2fs_zoned print. To make the message consistent through the all helper functions, modify message strings in f2fs_check_zones() and f2fs_reset_zones(). Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Jaegeu

[f2fs-dev] [PATCH v7 8/8] fsck: Check write pointer consistency of non-open zones

2019-11-13 Thread Shin'ichiro Kawasaki
zone get discarded. In the same manner as the consistency check for current segments, do the check and fix twice: at the beginning of do_fsck() to avoid unaligned write error during fsck, and at fsck_verify() to reflect meta data updates by fsck. Signed-off-by: Shin'ichiro Kawasaki Review

[f2fs-dev] [PATCH v7 4/8] fsck: Find free zones instead of blocks to assign to current segments

2019-11-13 Thread Shin'ichiro Kawasaki
block devices. Also skip relocate_curseg_offset() for the devices with ZONED_HM model for the same reason. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/defrag.c | 2 +- fsck/f2fs.h| 1 + fsck/fsck.h| 2 +- fsck/mount.c | 13

[f2fs-dev] [PATCH v7 1/8] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-11-13 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 5 lib/libf2

[f2fs-dev] [PATCH v7 2/8] libf2fs_zoned: Introduce f2fs_report_zone() helper function

2019-11-13 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency check by fsck, add f2fs_report_zone() helper function which calls REPORT ZONE command to get write pointer status of a single zone. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'i

[f2fs-dev] [PATCH v7 6/8] fsck: Check fsync data always for zoned block devices

2019-11-13 Thread Shin'ichiro Kawasaki
fsck needs fsync data check or not. For zoned block devices, always return true. Otherwise, return true if UMOUNT flag is not set in CP. Replace UMOUNT flag check codes for fsync data with the function call. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeu

[f2fs-dev] [PATCH v7 0/8] fsck: Check write pointers of zoned block devices

2019-11-13 Thread Shin'ichiro Kawasaki
Set curseg position at a new zone start when its write pointer is at zone end Changes from v2: * Reflected review comments by Chao Yu * Dropped 4th patch and 2nd patch (2nd patch was required for the 4th patch) Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (

[f2fs-dev] [PATCH v3 2/2] f2fs: Check write pointer consistency of non-open zones

2019-11-14 Thread Shin'ichiro Kawasaki
ff-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 3 + fs/f2fs/segment.c | 149 ++ fs/f2fs/super.c | 16 - 3 files changed, 165 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a2e24718c13b..1bb64950d793 100644 ---

[f2fs-dev] [PATCH v3 1/2] f2fs: Check write pointer consistency of open zones

2019-11-14 Thread Shin'ichiro Kawasaki
t to cause conflict with kworker's dirfy data/node flush, do the fix within SBI_POR_DOING protection. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 17 ++- fs/f2fs/segment.c | 120 + 3 files cha

[f2fs-dev] [PATCH v3 0/2] f2fs: Check write pointers of zoned block devices

2019-11-14 Thread Shin'ichiro Kawasaki
checkpoint() * 2nd patch: Reversed bitmap search and removed __set_inuse() Changed condition for disable_roll_forward/norecovery mount options Changes from v1: * 2nd patch: Added check to ensure zones are in main segments Shin'ichiro Kawasaki (2): f2fs: Check write pointer cons

[f2fs-dev] [PATCH v8 6/8] fsck: Check fsync data always for zoned block devices

2019-11-28 Thread Shin'ichiro Kawasaki
fsck needs fsync data check or not. For zoned block devices, always return true. Otherwise, return true if UMOUNT flag is not set in CP. Replace UMOUNT flag check codes for fsync data with the function call. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeu

[f2fs-dev] [PATCH v8 7/8] fsck: Check write pointer consistency of open zones

2019-11-28 Thread Shin'ichiro Kawasaki
ther fixes can reflect the current segment modification. The second is done in fsck_verify() to reflect updated meta data by other fixes. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- fsck/f2fs.h | 5 ++ fsck/fsck.c | 159 ++

[f2fs-dev] [PATCH v8 0/8] fsck: Check write pointers of zoned block devices

2019-11-28 Thread Shin'ichiro Kawasaki
Changes from v1: * Fixed build failure on dev branch Shin'ichiro Kawasaki (8): libf2fs_zoned: Introduce f2fs_report_zones() helper function libf2fs_zoned: Introduce f2fs_report_zone() helper function libf2fs_zoned: Introduce f2fs_reset_zone() helper function fsck: Find free zones

[f2fs-dev] [PATCH v8 1/8] libf2fs_zoned: Introduce f2fs_report_zones() helper function

2019-11-28 Thread Shin'ichiro Kawasaki
t for each zone. Add SECTOR_SHIFT definition in include/f2fs_fs.h to avoid a magic number to convert bytes into 512B sectors. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 5 lib/libf2

[f2fs-dev] [PATCH v8 3/8] libf2fs_zoned: Introduce f2fs_reset_zone() helper function

2019-11-28 Thread Shin'ichiro Kawasaki
function f2fs_reset_zone() prints an error message as other helper functions in lib/libf2fs_zoned print. To make the message consistent through the all helper functions, modify message strings in f2fs_check_zones() and f2fs_reset_zones(). Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu S

[f2fs-dev] [PATCH v8 5/8] fsck: Introduce move_one_curseg_info() function

2019-11-28 Thread Shin'ichiro Kawasaki
: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/mount.c | 68 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 7ce885c..cd6b51b 100644 --- a/fsck/mount.c +++ b/fsck/mo

[f2fs-dev] [PATCH v8 2/8] libf2fs_zoned: Introduce f2fs_report_zone() helper function

2019-11-28 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency check by fsck, add f2fs_report_zone() helper function which calls REPORT ZONE command to get write pointer status of a single zone. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'i

[f2fs-dev] [PATCH v8 4/8] fsck: Find free zones instead of blocks to assign to current segments

2019-11-28 Thread Shin'ichiro Kawasaki
block devices. Also skip relocate_curseg_offset() for the devices with ZONED_HM model for the same reason. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/defrag.c | 2 +- fsck/f2fs.h| 1 + fsck/fsck.h| 2 +- fsck/mount.c | 13

[f2fs-dev] [PATCH v8 8/8] fsck: Check write pointer consistency of non-open zones

2019-11-28 Thread Shin'ichiro Kawasaki
zone get discarded. In the same manner as the consistency check for current segments, do the check and fix twice: at the beginning of do_fsck() to avoid unaligned write error during fsck, and at fsck_verify() to reflect meta data updates by fsck. Signed-off-by: Shin'ichiro Kawasaki Review

[f2fs-dev] [PATCH v4 2/2] f2fs: Check write pointer consistency of non-open zones

2019-12-02 Thread Shin'ichiro Kawasaki
block position is beyond the write pointer. In such a case, report as a bug. Fix is not required for such zone, because the zone is not selected for next write operation until the zone get discarded. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segme

[f2fs-dev] [PATCH v4 1/2] f2fs: Check write pointer consistency of open zones

2019-12-02 Thread Shin'ichiro Kawasaki
e conflict with kworker's dirfy data/node flush, do the fix within SBI_POR_DOING protection. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 20 ++- fs/f2fs/segment.c | 131 + 3 files changed,

[f2fs-dev] [PATCH v4 0/2] f2fs: Check write pointers of zoned block devices

2019-12-02 Thread Shin'ichiro Kawasaki
set_inuse() and f2fs_stop_checkpoint() * 2nd patch: Reversed bitmap search and removed __set_inuse() Changed condition for disable_roll_forward/norecovery mount options Changes from v1: * 2nd patch: Added check to ensure zones are in main segments Shin'ichiro Kawasaki (2): f2fs: Check write

[f2fs-dev] [PATCH v5 2/2] f2fs: Check write pointer consistency of non-open zones

2019-12-09 Thread Shin'ichiro Kawasaki
block position is beyond the write pointer. In such a case, report as a bug. Fix is not required for such zone, because the zone is not selected for next write operation until the zone get discarded. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segme

[f2fs-dev] [PATCH v5 0/2] f2fs: Check write pointers of zoned block devices

2019-12-09 Thread Shin'ichiro Kawasaki
Added check to ensure zones are in main segments Shin'ichiro Kawasaki (2): f2fs: Check write pointer consistency of open zones f2fs: Check write pointer consistency of non-open zones fs/f2fs/f2fs.h | 2 + fs/f2fs/recovery.c | 20 +++- fs/f

[f2fs-dev] [PATCH v5 1/2] f2fs: Check write pointer consistency of open zones

2019-12-09 Thread Shin'ichiro Kawasaki
e conflict with kworker's dirfy data/node flush, do the fix within SBI_POR_DOING protection. Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 20 ++- fs/f2fs/segment.c | 132 + 3 files changed,

[f2fs-dev] [PATCH v6 1/2] f2fs: Check write pointer consistency of open zones

2020-01-14 Thread Shin'ichiro Kawasaki
e conflict with kworker's dirfy data/node flush, do the fix within SBI_POR_DOING protection. Signed-off-by: Shin'ichiro Kawasaki Cc: YueHaibing --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 20 ++- fs/f2fs/segment.c | 131 +

[f2fs-dev] [PATCH v6 2/2] f2fs: Check write pointer consistency of non-open zones

2020-01-14 Thread Shin'ichiro Kawasaki
block position is beyond the write pointer. In such a case, report as a bug. Fix is not required for such zone, because the zone is not selected for next write operation until the zone get discarded. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Chao Yu --- fs/f2fs/f2fs.h| 1

[f2fs-dev] [PATCH v6 0/2] f2fs: Check write pointers of zoned block devices

2020-01-14 Thread Shin'ichiro Kawasaki
d condition for disable_roll_forward/norecovery mount options Changes from v1: * 2nd patch: Added check to ensure zones are in main segments Shin'ichiro Kawasaki (2): f2fs: Check write pointer consistency of open zones f2fs: Check write pointer consistency of non-open zones fs/f2fs/f2fs.h | 2 +

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

2019-04-10 Thread Shin'ichiro Kawasaki
ce attributes. Also introduce read_file() and read_sys_attr() helper functions for code simplicity. Signed-off-by: Shin'ichiro Kawasaki --- lib/libf2fs_zoned.c | 134 ++-- 1 file changed, 91 insertions(+), 43 deletions(-) diff --git a/lib/libf2fs_zone

[f2fs-dev] [PATCH v2] f2fs-tools: Fix device zoned model detection

2019-04-19 Thread Shin'ichiro Kawasaki
ince the device file is already open, it exists, and so the device can safely be assumed as not being zoned. Changes from v1: * Addressed Chao Yu's comment on ENOENT and return value checks * Rewrite of sysfs file handling (simplified) * Rebased on dev-test tree Signed-off-by: Shin&#x

[f2fs-dev] [PATCH v3] f2fs-tools: Fix device zoned model detection

2019-04-21 Thread Shin'ichiro Kawasaki
e handling (simplified) * Rebased on dev-test tree Signed-off-by: Shin'ichiro Kawasaki --- lib/libf2fs_zoned.c | 101 ++-- 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c index a5f3fea..af00b44 100

[f2fs-dev] [PATCH] f2fs: Fix type of section block count variables

2020-08-18 Thread Shin'ichiro Kawasaki
"f2fs: get the right gc victim section when section has several segments") Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/segment.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a65d357f89a9..e247a5ef3713 1006

[f2fs-dev] [PATCH] f2fs: Prevent swap file on zoned block devices

2021-05-09 Thread Shin'ichiro Kawasaki
, prevent swap file activation when the filesystem enables block zoned device support. Fixes: 4969c06a0d83 ("f2fs: support swap file w/ DIO") Signed-off-by: Shin'ichiro Kawasaki Cc: sta...@vger.kernel.org # v5.4+ --- fs/f2fs/data.c | 6 ++ 1 file changed, 6 insertions(+) diff

[f2fs-dev] [PATCH v2] f2fs: Prevent swap file in LFS mode

2021-05-10 Thread Shin'ichiro Kawasaki
-sequential write causes unaligned write command errors. To avoid the non-sequential writes to swap files, prevent swap file activation when the filesystem is in LFS mode. Fixes: 4969c06a0d83 ("f2fs: support swap file w/ DIO") Signed-off-by: Shin'ichiro Kawasaki Cc: sta...@vger.ker

[f2fs-dev] [PATCH] f2fs: check zone type before sending async reset zone command

2023-08-04 Thread Shin'ichiro Kawasaki via Linux-f2fs-devel
t purpose, add a new helper function f2fs_bdev_index() which gets index of the zone reset target device. Fixes: 25f9080576b9 ("f2fs: add async reset zone command support") Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/f2fs.h| 16 fs/f2fs/segment.c | 35 +++

[f2fs-dev] [PATCH] f2fs: check discard support for conventional zones

2024-08-15 Thread Shin'ichiro Kawasaki via Linux-f2fs-devel
ernel.org Signed-off-by: Shin'ichiro Kawasaki --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 78c3198a6308..e10bf3c4eed5 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1281,6 +1281,8 @@ static int __submit_dis

[f2fs-dev] [PATCH v2] f2fs: check discard support for conventional zones

2024-08-15 Thread Shin'ichiro Kawasaki via Linux-f2fs-devel
r.kernel.org Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Damien Le Moal --- Changes from v1: * Removed the else, added the comment and improved commit message wording fs/f2fs/segment.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c inde