diff mbox series

[f2fs-dev] mkfs.f2fs: don't trim on aliased partition

Message ID 20241015165616.65434-1-jaegeuk@kernel.org (mailing list archive)
State New
Headers show
Series [f2fs-dev] mkfs.f2fs: don't trim on aliased partition | expand

Commit Message

Jaegeuk Kim Oct. 15, 2024, 4:56 p.m. UTC
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 mkfs/f2fs_format_utils.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Daeho Jeong Oct. 15, 2024, 5:01 p.m. UTC | #1
Reviewed-by: Daeho Jeong <daehojeong@google.com>

Thanks,

On Tue, Oct 15, 2024 at 9:58 AM Jaegeuk Kim via Linux-f2fs-devel
<linux-f2fs-devel@lists.sourceforge.net> wrote:
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  mkfs/f2fs_format_utils.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
> index 1c2003e8d107..1a9746a77184 100644
> --- a/mkfs/f2fs_format_utils.c
> +++ b/mkfs/f2fs_format_utils.c
> @@ -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
>
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
diff mbox series

Patch

diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
index 1c2003e8d107..1a9746a77184 100644
--- a/mkfs/f2fs_format_utils.c
+++ b/mkfs/f2fs_format_utils.c
@@ -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");