mkfs.f2fs: fix sparse_mode case on stat
PATCH 1/1 mkfs.f2fs: fix sparse_mode case on stat
When we turn on sparse_mode, stat() will be failed, as the file will be created afterwards. Let's fix.
--- lib/libf2fs.c | 3 +++ 1 file changed, 3 insertions(+)
lib/libf2fs.c +3 -0
@@ -814,6 +814,9 @@ int f2fs_dev_is_umounted(char *path)* the file system. In this case, we should not format. */ if (stat (path, &st_buf)) { +/* sparse file will be created after this. */ +if (c.sparse_mode) +return 0 ;MSG (0 ,"Info: stat failed errno:%d\n" , errno);return -1 ; }
Signature · 8 lines
2.43.0.687.g38aa6559b0-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 29 lines · Jaegeuk Kim
When we turn on
sparse_mode,stat()will be failed, as the file will be created afterwards. Let's fix.Fixes 14197d546b93 ("f2fs-tools: fix to check loop device")Signed-off-by Jaegeuk Kim <[email protected]>--- lib/libf2fs.c | 3 +++ 1 file changed, 3 insertions(+)lib/libf2fs.c +3
-1@@ -814,6 +814,9 @@ int f2fs_dev_is_umounted(char *path)* the file system. In this case, we should not format. */ if (stat (path, &st_buf)) { +/* sparse file will be created after this. */ +if (c.sparse_mode) +return 0 ;MSG (0 ,"Info: stat failed errno:%d\n" , errno);return -1 ; } --2.43.0.687.g38aa6559b0-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
Quoted 5 lines · Jaegeuk Kim
When we turn on
sparse_mode,stat()will be failed, as the file will be created afterwards. Let's fix.Fixes 14197d546b93 ("f2fs-tools: fix to check loop device")Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel