From 9bd80748620a75a34a4788535f89be37dbdeaab3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 3 Jun 2023 13:49:18 +0200 Subject: [PATCH] libblkid: (bcache) report block size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- libblkid/src/superblocks/bcache.c | 3 +++ tests/expected/blkid/low-probe-bcache-B | 1 + tests/expected/blkid/low-probe-bcache-C | 1 + tests/expected/blkid/low-probe-bcache-journal | 1 + 4 files changed, 6 insertions(+) diff --git a/libblkid/src/superblocks/bcache.c b/libblkid/src/superblocks/bcache.c index a4a33614a3..bf7fed01fe 100644 --- a/libblkid/src/superblocks/bcache.c +++ b/libblkid/src/superblocks/bcache.c @@ -194,6 +194,9 @@ static int probe_bcache (blkid_probe pr, const struct blkid_idmag *mag) if (blkid_probe_set_label(pr, bcs->label, sizeof(bcs->label)) < 0) return BLKID_PROBE_NONE; + if (blkid_probe_set_block_size(pr, le16_to_cpu(bcs->block_size) * 512)) + return BLKID_PROBE_NONE; + blkid_probe_set_wiper(pr, 0, BCACHE_SB_OFF); return BLKID_PROBE_OK; diff --git a/tests/expected/blkid/low-probe-bcache-B b/tests/expected/blkid/low-probe-bcache-B index 6593209252..2753678bf9 100644 --- a/tests/expected/blkid/low-probe-bcache-B +++ b/tests/expected/blkid/low-probe-bcache-B @@ -1,3 +1,4 @@ +ID_FS_BLOCK_SIZE=4096 ID_FS_TYPE=bcache ID_FS_USAGE=other ID_FS_UUID=8fb7f716-4c19-4517-bfbb-6f4a2becad60 diff --git a/tests/expected/blkid/low-probe-bcache-C b/tests/expected/blkid/low-probe-bcache-C index 2188211b84..da4b314230 100644 --- a/tests/expected/blkid/low-probe-bcache-C +++ b/tests/expected/blkid/low-probe-bcache-C @@ -1,3 +1,4 @@ +ID_FS_BLOCK_SIZE=4096 ID_FS_TYPE=bcache ID_FS_USAGE=other ID_FS_UUID=7a343627-ac87-4bf0-b76f-46067cbc9b8c diff --git a/tests/expected/blkid/low-probe-bcache-journal b/tests/expected/blkid/low-probe-bcache-journal index 966c3eff1f..cfff870c07 100644 --- a/tests/expected/blkid/low-probe-bcache-journal +++ b/tests/expected/blkid/low-probe-bcache-journal @@ -1,3 +1,4 @@ +ID_FS_BLOCK_SIZE=4096 ID_FS_LABEL=journal-cache ID_FS_LABEL_ENC=journal-cache ID_FS_TYPE=bcache -- 2.47.3