Skip to contentSkip to conversation

mkfs.f2fs: don't trim on aliased partition

PATCH In review Jaegeuk Kim via Linux-f2fs-devel 2 participants 2 messages Oct 15, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.f2fs: don't trim on aliased partition

---
 mkfs/f2fs_format_utils.c | 5 +++++
 1 file changed, 5 insertions(+)
mkfs/f2fs_format_utils.c +5 -0
index 1c2003e8d107..1a9746a77184 100644
@@ -48,6 +48,11 @@ static int trim_device(int i)
 	uint64_t bytes = dev->total_sectors * dev->sector_size;
 	int fd = dev->fd;
 
+	if (dev->alias_filename) {
+		MSG(0, "Info: [%s] Skip Discarding as aliased\n", dev->path);
+		return 0;
+	}
+
 	stat_buf = malloc(sizeof(struct stat));
 	if (stat_buf == NULL) {
 		MSG(1, "\tError: Malloc Failed for trim_stat_buf!!!\n");
Signature · 8 lines
2.47.0.rc1.288.g06298d1525-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Reviewed-by on v1 1/1
#1 lore raw

Thanks,

Quoted 27 lines · On Tue, Oct 15, 2024 at 9:58 AM Jaegeuk Kim via Linux-f2fs-devel…
---
 mkfs/f2fs_format_utils.c | 5 +++++
 1 file changed, 5 insertions(+)
mkfs/f2fs_format_utils.c +5 -1
index 1c2003e8d107..1a9746a77184 100644
@@ -48,6 +48,11 @@ static int trim_device(int i)
        uint64_t bytes = dev->total_sectors * dev->sector_size;
        int fd = dev->fd;
 
+       if (dev->alias_filename) {
+               MSG(0, "Info: [%s] Skip Discarding as aliased\n", dev->path);
+               return 0;
+       }
+
        stat_buf = malloc(sizeof(struct stat));
        if (stat_buf == NULL) {
                MSG(1, "\tError: Malloc Failed for trim_stat_buf!!!\n");
--

2.47.0.rc1.288.g06298d1525-goog

Quoted 4 lines

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel