Skip to contentSkip to conversation

f2fs-tools: fix cannot get bdev information

PATCH New Ben Chang 1 participant 1 message Jun 17, 2022

lore
Share & tools
lore

Ben Chang

author
#0 lore raw

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

---
 tools/fibmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fibmap.c +1 -1
index 3238f29..9f94b53 100644
@@ -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