For multiple devices, the c.start_sector will be overwrite by the non-root devices.
Signed-off-by: Kinglong Mee <kinglong...@gmail.com> --- lib/libf2fs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 93d3da9..bb32df8 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -730,10 +730,12 @@ int get_device_info(int i) #endif dev->total_sectors /= dev->sector_size; - if (ioctl(fd, HDIO_GETGEO, &geom) < 0) - c.start_sector = 0; - else - c.start_sector = geom.start; + if (i == 0) { + if (ioctl(fd, HDIO_GETGEO, &geom) < 0) + c.start_sector = 0; + else + c.start_sector = geom.start; + } #ifndef WITH_ANDROID /* Send INQUIRY command */ -- 2.9.3 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel