For a zoned blocks device, trim must reset all sequential zones
of the device.

Signed-off-by: Damien Le Moal <damien.lem...@wdc.com>
---
 mkfs/f2fs_format_utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
index d469ce5..654c22b 100644
--- a/mkfs/f2fs_format_utils.c
+++ b/mkfs/f2fs_format_utils.c
@@ -61,6 +61,8 @@ int f2fs_trim_device()
 #endif
                return 0;
        } else if (S_ISBLK(stat_buf.st_mode)) {
+               if (config.zoned_mode)
+                       return f2fs_reset_zones(&config);
 #ifdef BLKSECDISCARD
                if (ioctl(config.fd, BLKSECDISCARD, &range) < 0) {
                        MSG(0, "Info: This device doesn't support 
BLKSECDISCARD\n");
-- 
2.7.4

Western Digital Corporation (and its subsidiaries) E-mail Confidentiality 
Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or 
legally privileged information of WDC and/or its affiliates, and are intended 
solely for the use of the individual or entity to which they are addressed. If 
you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, is prohibited. If 
you have received this e-mail in error, please notify the sender immediately 
and delete the e-mail in its entirety from your system.


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to