mkfs.f2fs: reset sequential zones on device discard
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 28 Oct 2016 07:57:02 +0000 (16:57 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 2 Nov 2016 00:27:35 +0000 (17:27 -0700)
For a zoned blocks device, trim must reset all sequential zones
of the device.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
mkfs/f2fs_format_utils.c

index ba93308..d204bd4 100644 (file)
@@ -58,6 +58,8 @@ int f2fs_trim_device(int fd, u_int64_t bytes)
 #endif
                return 0;
        } else if (S_ISBLK(stat_buf.st_mode)) {
+               if (c.zoned_mode)
+                       return f2fs_reset_zones();
 #ifdef BLKSECDISCARD
                if (ioctl(fd, BLKSECDISCARD, &range) < 0) {
                        MSG(0, "Info: This device doesn't support BLKSECDISCARD\n");