partname_volume_init() calls block_volume_format() passing the device path.

Previously the parent path was passed typically leading to retrieve the
size of the parent device and not the device to be formatted. Eventually,
formatting the block device with mkfs.f2fs failed silently when the block
device is too small and created a ram overlayfs instead of trying to format
with ext4.

Signed-off-by: Paul HENRYS <[email protected]>
---
 libfstools/partname.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfstools/partname.c b/libfstools/partname.c
index 9f2347a..836abf0 100644
--- a/libfstools/partname.c
+++ b/libfstools/partname.c
@@ -56,7 +56,7 @@ static int partname_volume_init(struct volume *v)
        v->size = volsize << 9; /* size is returned in sectors of 512 bytes */
        v->blk = p->dev.devpathstr;
 
-       return block_volume_format(v, 0, p->parent_dev.devpathstr);
+       return block_volume_format(v, 0, p->dev.devpathstr);
 }
 
 /* adapted from procd/utils.c -> should go to libubox */
-- 
2.43.0


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to