From: Ben Chang <ben.chang@sonicsky.net>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Ben Chang <ben.chang@sonicsky.net>
Subject: [f2fs-dev] [PATCH] f2fs-tools: fix cannot get bdev information
Date: Fri, 17 Jun 2022 10:51:52 +0800 [thread overview]
Message-ID: <20220617025152.50511-1-ben.chang@sonicsky.net> (raw)
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 <ben.chang@sonicsky.net>
---
tools/fibmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/fibmap.c b/tools/fibmap.c
index 3238f29..9f94b53 100644
--- a/tools/fibmap.c
+++ b/tools/fibmap.c
@@ -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)
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2022-06-17 3:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 2:51 Ben Chang [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-20 3:53 [f2fs-dev] [PATCH] f2fs-tools: fix cannot get bdev information Ben Chang
2022-06-21 16:39 ` Jaegeuk Kim
2022-06-22 13:02 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220617025152.50511-1-ben.chang@sonicsky.net \
--to=ben.chang@sonicsky.net \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).