From: Sheng Yong <[email protected]>
Signed-off-by: Sheng Yong <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
---
lib/libf2fs_zoned.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c
index 6730bba0da82..92791a768807 100644
--- a/lib/libf2fs_zoned.c
+++ b/lib/libf2fs_zoned.c
@@ -429,7 +429,7 @@ int f2fs_reset_zone(int i, void *blkzone)
struct blk_zone_range range;
int ret;
- if (!blk_zone_seq(blkz) || blk_zone_empty(blkz))
+ if (!blk_zone_seq(blkz) || blk_zone_empty(blkz) || c.dry_run)
return 0;
/* Non empty sequential zone: reset */
@@ -484,7 +484,7 @@ int f2fs_reset_zones(int j)
blkz = (struct blk_zone *)(rep + 1);
for (i = 0; i < rep->nr_zones && sector < total_sectors; i++) {
if (blk_zone_seq(blkz) &&
- !blk_zone_empty(blkz)) {
+ !blk_zone_empty(blkz) && !c.dry_run) {
/* Non empty sequential zone: reset */
range.sector = blk_zone_sector(blkz);
range.nr_sectors = blk_zone_length(blkz);
@@ -513,7 +513,7 @@ int f2fs_finish_zone(int i, void *blkzone)
struct blk_zone_range range;
int ret;
- if (!blk_zone_seq(blkz) || !blk_zone_open(blkz))
+ if (!blk_zone_seq(blkz) || !blk_zone_open(blkz) || c.dry_run)
return 0;
/* Non empty sequential zone: finish */
--
2.43.0
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel