From: Thomas Weißschuh Date: Sat, 3 Jun 2023 09:15:13 +0000 (+0200) Subject: libblkid: (bcache) report version X-Git-Tag: v2.40-rc1~405^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b2efad216d3ca4421f51259daeb777f5c919d66;p=thirdparty%2Futil-linux.git libblkid: (bcache) report version Signed-off-by: Thomas Weißschuh --- diff --git a/libblkid/src/superblocks/bcache.c b/libblkid/src/superblocks/bcache.c index c3c84105a0..a4a33614a3 100644 --- a/libblkid/src/superblocks/bcache.c +++ b/libblkid/src/superblocks/bcache.c @@ -10,6 +10,7 @@ #include #include +#include #include "superblocks.h" #include "crc32c.h" @@ -184,6 +185,9 @@ static int probe_bcache (blkid_probe pr, const struct blkid_idmag *mag) if (le64_to_cpu(bcs->offset) != BCACHE_SB_OFF / 512) return BLKID_PROBE_NONE; + if (blkid_probe_sprintf_version(pr, "%"PRIu64, le64_to_cpu(bcs->version)) < 0) + return BLKID_PROBE_NONE; + if (blkid_probe_set_uuid(pr, bcs->uuid) < 0) return BLKID_PROBE_NONE; diff --git a/tests/expected/blkid/low-probe-bcache-B b/tests/expected/blkid/low-probe-bcache-B index 7396632088..6593209252 100644 --- a/tests/expected/blkid/low-probe-bcache-B +++ b/tests/expected/blkid/low-probe-bcache-B @@ -2,3 +2,4 @@ ID_FS_TYPE=bcache ID_FS_USAGE=other ID_FS_UUID=8fb7f716-4c19-4517-bfbb-6f4a2becad60 ID_FS_UUID_ENC=8fb7f716-4c19-4517-bfbb-6f4a2becad60 +ID_FS_VERSION=1 diff --git a/tests/expected/blkid/low-probe-bcache-C b/tests/expected/blkid/low-probe-bcache-C index b3c5f88f99..2188211b84 100644 --- a/tests/expected/blkid/low-probe-bcache-C +++ b/tests/expected/blkid/low-probe-bcache-C @@ -2,3 +2,4 @@ ID_FS_TYPE=bcache ID_FS_USAGE=other ID_FS_UUID=7a343627-ac87-4bf0-b76f-46067cbc9b8c ID_FS_UUID_ENC=7a343627-ac87-4bf0-b76f-46067cbc9b8c +ID_FS_VERSION=0 diff --git a/tests/expected/blkid/low-probe-bcache-journal b/tests/expected/blkid/low-probe-bcache-journal index d61ea279f0..966c3eff1f 100644 --- a/tests/expected/blkid/low-probe-bcache-journal +++ b/tests/expected/blkid/low-probe-bcache-journal @@ -4,3 +4,4 @@ ID_FS_TYPE=bcache ID_FS_USAGE=other ID_FS_UUID=fc6ea56f-372e-474e-bc5b-2ddc8430ddd1 ID_FS_UUID_ENC=fc6ea56f-372e-474e-bc5b-2ddc8430ddd1 +ID_FS_VERSION=3