]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: f2fs: report fssize
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 30 Nov 2022 02:38:16 +0000 (03:38 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 13 Dec 2022 18:35:18 +0000 (18:35 +0000)
libblkid/src/superblocks/f2fs.c
tests/expected/blkid/low-probe-f2fs

index ce796098ae3e44bccd54e39ba24cc061ffcf2118..980111ef37b2021f06e42fc647dff296117527b2 100644 (file)
@@ -110,8 +110,10 @@ static int probe_f2fs(blkid_probe pr, const struct blkid_idmag *mag)
        blkid_probe_set_uuid(pr, sb->uuid);
        blkid_probe_sprintf_version(pr, "%u.%u", vermaj, vermin);
        if (le32_to_cpu(sb->log_blocksize) < 32){
-               blkid_probe_set_fsblocksize(pr, 1U << le32_to_cpu(sb->log_blocksize));
-               blkid_probe_set_block_size(pr, 1U << le32_to_cpu(sb->log_blocksize));
+               uint32_t blocksize = 1U << le32_to_cpu(sb->log_blocksize);
+               blkid_probe_set_fsblocksize(pr, blocksize);
+               blkid_probe_set_block_size(pr, blocksize);
+               blkid_probe_set_fssize(pr, le64_to_cpu(sb->block_count) * blocksize);
        }
        return 0;
 }
index 77f93277a7298d8cea23b706095e116c6e26cc39..d1c01674ccaaacb09e66125a7c9bc024acf9c0ec 100644 (file)
@@ -1,5 +1,6 @@
 ID_FS_BLOCK_SIZE=4096
 ID_FS_FSBLOCKSIZE=4096
+ID_FS_FSSIZE=148897792
 ID_FS_LABEL=test-f2fs
 ID_FS_LABEL_ENC=test-f2fs
 ID_FS_TYPE=f2fs