libf2fs: avoid overwrite the c.start_sector by non-root device
PATCH 1/1 libf2fs: avoid overwrite the c.start_sector by non-root device
For multiple devices, the c.start_sector will be overwrite by the non-root devices.
Signed-off-by Kinglong Mee <[email protected]>
--- lib/libf2fs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
lib/libf2fs.c +6 -4
@@ -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 */
Signature · 6 lines
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