f2fs-tools: fix cannot get bdev information
PATCH 1/1 f2fs-tools: fix cannot get bdev information
Some device like android phone doesn't show the dev number path in /dev/block/, but most of devices show in /sys/dev/block
Signed-off-by Ben Chang <[email protected]>
--- tools/fibmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fibmap.c +1 -1
@@ -102,7 +102,7 @@ static void stat_bdev(struct stat *st, unsigned int *start_lba)char linkname[32 ] = {0 , };int fd; -sprintf (devname,"/dev/block/%d:%d" ,major (st->st_dev),minor (st->st_dev)); +sprintf (devname,"/sys/dev/block/%d:%d" ,major (st->st_dev),minor (st->st_dev)); fd =open (devname,O_RDONLY );if (fd <0 )
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel