From 1d474f26f84a4331eab594348b7c74d646505fd1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 28 2020 07:30:17 +0000 Subject: import util-linux-2.32.1-24.el8 --- diff --git a/SOURCES/0029-lscpu-use-the-first-VM-from-proc-sysinfo.patch b/SOURCES/0029-lscpu-use-the-first-VM-from-proc-sysinfo.patch new file mode 100644 index 0000000..9552768 --- /dev/null +++ b/SOURCES/0029-lscpu-use-the-first-VM-from-proc-sysinfo.patch @@ -0,0 +1,28 @@ +From 6f16035b81cd7feca02d6df8eff1bb954ed7e58d Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 4 Sep 2018 14:30:37 +0200 +Subject: [PATCH 29/32] lscpu: use the first VM from /proc/sysinfo + +Addresses: https://github.com/karelzak/util-linux/issues/685 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1739443 +Upstream: http://github.com/karelzak/util-linux/commit/350f5c8df2cb6edbfb5bae95f00a9fff446d236c +Signed-off-by: Karel Zak +--- + sys-utils/lscpu.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c +index fd6d63bbf..1aa7bff4d 100644 +--- a/sys-utils/lscpu.c ++++ b/sys-utils/lscpu.c +@@ -866,6 +866,7 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod) + *(str--) = '\0'; + while ((str = strstr(desc->hypervisor, " "))) + memmove(str, str + 1, strlen(str)); ++ break; + } + fclose(fd); + } +-- +2.21.0 + diff --git a/SOURCES/0030-tests-lscpu-s390-nested-virtualization.patch b/SOURCES/0030-tests-lscpu-s390-nested-virtualization.patch new file mode 100644 index 0000000..fa71cbc --- /dev/null +++ b/SOURCES/0030-tests-lscpu-s390-nested-virtualization.patch @@ -0,0 +1,206 @@ +From e10bdfc6cd623f02740cf2bcfd9867c56534c5e5 Mon Sep 17 00:00:00 2001 +From: Radka Skvarilova +Date: Sun, 22 Sep 2019 13:49:45 +0200 +Subject: [PATCH 30/32] tests: lscpu s390 nested virtualization + +Signed-off-by: Radka Skvarilova +Addresses:https://bugzilla.redhat.com/show_bug.cgi?id=1739443 +Upstream: http://github.com/karelzak/util-linux/commit/2062164894fffa314ecb7ac99dc6c98062484389 +--- + tests/expected/lscpu/lscpu-s390-nested-virt | 45 +++++++++++++++++++ + tests/ts/lscpu/dumps/s390-nested-virt.tar.gz | Bin 0 -> 7199 bytes + 2 files changed, 45 insertions(+) + create mode 100644 tests/expected/lscpu/lscpu-s390-nested-virt + create mode 100644 tests/ts/lscpu/dumps/s390-nested-virt.tar.gz + +diff --git a/tests/expected/lscpu/lscpu-s390-nested-virt b/tests/expected/lscpu/lscpu-s390-nested-virt +new file mode 100644 +index 000000000..2665fd8dc +--- /dev/null ++++ b/tests/expected/lscpu/lscpu-s390-nested-virt +@@ -0,0 +1,45 @@ ++CPU op-mode(s): 32-bit, 64-bit ++CPU(s): 2 ++On-line CPU(s) list: 0,1 ++Thread(s) per core: 1 ++Core(s) per socket: 1 ++Socket(s) per book: 1 ++Book(s) per drawer: 1 ++Drawer(s): 2 ++NUMA node(s): 1 ++Vendor ID: IBM/S390 ++Machine type: 2964 ++CPU dynamic MHz: 5000 ++CPU static MHz: 5000 ++BogoMIPS: 3033.00 ++Hypervisor: KVM/Linux ++Hypervisor vendor: KVM ++Virtualization type: full ++Dispatching mode: horizontal ++L1d cache: 256 KiB ++L1i cache: 192 KiB ++L2d cache: 4 MiB ++L2i cache: 4 MiB ++L3 cache: 64 MiB ++L4 cache: 480 MiB ++NUMA node0 CPU(s): 0,1 ++Vulnerability L1tf: Not affected ++Vulnerability Meltdown: Not affected ++Vulnerability Spec store bypass: Not affected ++Vulnerability Spectre v1: Mitigation; __user pointer sanitization ++Vulnerability Spectre v2: Mitigation; execute trampolines ++Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx ++ ++# The following is the parsable format, which can be fed to other ++# programs. Each different item in every column has an unique ID ++# starting from zero. ++# CPU,Core,Socket,Node,,L1d,L1i,L2d,L2i ++0,0,0,0,,0,0,0,0 ++1,1,1,0,,1,1,1,1 ++ ++# The following is the parsable format, which can be fed to other ++# programs. Each different item in every column has an unique ID ++# starting from zero. ++# CPU,Core,Socket,Node,,L1d,L1i,L2d,L2i ++0,0,0,0,,0,0,0,0 ++1,1,1,0,,1,1,1,1 +diff --git a/tests/ts/lscpu/dumps/s390-nested-virt.tar.gz b/tests/ts/lscpu/dumps/s390-nested-virt.tar.gz +new file mode 100644 +index 0000000000000000000000000000000000000000..7992699925395ed8d33b1e1466b74fc1aa235268 +GIT binary patch +literal 7199 +zcmb7|dpK14zsFsYO}nPFYuZ%PMd^Z336(4*TcRer3sNpgD3MZbv80PMNo`w{G9oG0 +zqzEx26v{10($JJUV=(5n*7}?^*}wgq^E~G{&vW`mYx%D4_jCJx-mecD^A|aJ^PPv} +z6bJ7eib<%-zkE8l+t#n8FlzI-@}kEz)axa}w(L)lt9PBsIIOAv%}zn7;nQdi5~WYu +zJ{neZKDMS$*w*%R=W)|!D?0w%vFL^?&s?4AW{mpAeg7e#;9SqG91c9*fS(3`-H^qX +z)Y3P;zr?$Q=%Hctr>gQ-q}_}aRkprjf_!Sec}n^BcIEO=O+sXSYPld#Gv=x#>uuQE8!Mw%zW>{Khm+}=AL~*n*W=aKaa>K@OPx!P +zguV%1Gi}4PWz*(N3z^$bNkO8j|F|199x+Se`nIt}`;Lxl^yalL86sWBl5d$`PJFZV +zNm+ZiQo9+&DG_(p0SmlkLwX; +zO@+n&> +zb%o^pf&LUq1pBnAcfeJ))LRVEyaF(6Pp&pe3IqnMY=o3fvB>ABC4(bBCXz0skmYlS +zi$wF(I?npN{KE=h6QA-xwGq-frF{BXr4A8&CUy|cZ^c%MW~Mr9ewKdOQ~W)bmQfv+ +z`M!l$v}uz|+Fw*Es7>W1S^T-8fkg)C5>7EnE3PN@{FKlTbixS +zfy8@Xn-%}6h;2*oNQt=oW4LRxyKSgZM@z+~wgEAe9^o~KYx~^;O1{4vT_)AJepS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URCES/0031-chfn-don-t-append-extra-tailing-commas.patch new file mode 100644 index 0000000..256b95f --- /dev/null +++ b/SOURCES/0031-chfn-don-t-append-extra-tailing-commas.patch @@ -0,0 +1,43 @@ +From 90d4faece26c328c40336a0e02b875515c503e30 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 19 Aug 2019 14:03:07 +0200 +Subject: [PATCH 31/32] chfn: don't append extra tailing commas + + # grep kzak /etc/passwd + kzak:x:1000:1000::/home/kzak:/bin/bash + + # chfn kzak + ... + grep kzak /etc/passwd + +old version: + kzak:x:1000:1000:Karel Zak,,,,:/home/kzak:/bin/bash + +fixed version: + kzak:x:1000:1000:Karel Zak:/home/kzak:/bin/bash + +Reported-by: Filip Dvorak +References: f723cbf544a7eac2927634f2cb6d802437a2d519 +Upstream: http://github.com/karelzak/util-linux/commit/9210c0d225fd808da451d86055bf243a8b47a525 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1743555 +Signed-off-by: Karel Zak +--- + login-utils/chfn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/login-utils/chfn.c b/login-utils/chfn.c +index c5312fa0c..4f32604c5 100644 +--- a/login-utils/chfn.c ++++ b/login-utils/chfn.c +@@ -377,7 +377,7 @@ static int save_new_data(struct chfn_control *ctl) + ctl->newf.other); + + /* remove trailing empty fields (but not subfields of ctl->newf.other) */ +- if (!ctl->newf.other) { ++ if (!ctl->newf.other || !*ctl->newf.other) { + while (len > 0 && gecos[len - 1] == ',') + len--; + gecos[len] = 0; +-- +2.21.0 + diff --git a/SOURCES/0032-tests-add-new-test-for-chfn-gecos.patch b/SOURCES/0032-tests-add-new-test-for-chfn-gecos.patch new file mode 100644 index 0000000..646efc0 --- /dev/null +++ b/SOURCES/0032-tests-add-new-test-for-chfn-gecos.patch @@ -0,0 +1,83 @@ +From 447b7d7222bf8cb3591d611aa51917bd4453f8d6 Mon Sep 17 00:00:00 2001 +From: Radka Skvarilova +Date: Mon, 16 Dec 2019 10:57:32 +0100 +Subject: [PATCH 32/32] tests: add new test for chfn gecos + +Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1743555 +Upstream: http://github.com/karelzak/util-linux/commit/02238bff663ce5fe823980d8119f3871cc348764 +Upstream: http://github.com/karelzak/util-linux/commit/b2ef43864f24b1a9c0c67fe2a7177a5110da1b6e +Signed-off-by: Karel Zak +--- + tests/commands.sh | 1 + + tests/expected/chfn/gecos | 6 ++++++ + tests/ts/chfn/gecos | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 43 insertions(+) + create mode 100644 tests/expected/chfn/gecos + create mode 100755 tests/ts/chfn/gecos + +diff --git a/tests/commands.sh b/tests/commands.sh +index 93100caf6..b56381c9e 100644 +--- a/tests/commands.sh ++++ b/tests/commands.sh +@@ -104,3 +104,4 @@ TS_CMD_UUIDPARSE=${TS_CMD_UUIDPARSE-"${ts_commandsdir}uuidparse"} + TS_CMD_WHEREIS=${TS_CMD_WHEREIS-"${ts_commandsdir}whereis"} + TS_CMD_WIPEFS=${TS_CMD_WIPEFS-"${ts_commandsdir}wipefs"} + TS_CMD_CHRT=${TS_CMD_CHRT-"${ts_commandsdir}chrt"} ++TS_CMD_CHFN=${TS_CMD_CHFN-"${ts_commandsdir}chfn"} +diff --git a/tests/expected/chfn/gecos b/tests/expected/chfn/gecos +new file mode 100644 +index 000000000..af7b81b6c +--- /dev/null ++++ b/tests/expected/chfn/gecos +@@ -0,0 +1,6 @@ ++Initialize user ++testuser_chfn_test:x:9899:9899::/home/testuser_chfn_test:/bin/bash ++Changing finger information for testuser_chfn_test. ++ ++Finger information changed. ++testuser_chfn_test:x:9899:9899:test_gecos:/home/testuser_chfn_test:/bin/bash +diff --git a/tests/ts/chfn/gecos b/tests/ts/chfn/gecos +new file mode 100755 +index 000000000..aad27d40a +--- /dev/null ++++ b/tests/ts/chfn/gecos +@@ -0,0 +1,36 @@ ++#!/bin/bash ++ ++# ++# Copyright (C) 2019 Radka Skvarilova ++# ++# This file is part of util-linux. ++# ++# This file is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This file is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++ ++TS_TOPDIR="${0%/*}/../.." ++TS_DESC="gecos" ++ ++. $TS_TOPDIR/functions.sh ++ts_init "$*" ++ ++ts_skip_nonroot ++ts_check_test_command "$TS_CMD_CHFN" ++ts_check_prog "useradd" ++ts_check_prog "userdel" ++ ++ts_log "Initialize user" ++useradd -u 9899 --shell /bin/bash testuser_chfn_test ++grep testuser /etc/passwd >> $TS_OUTPUT ++$TS_CMD_CHFN -f test_gecos testuser_chfn_test >>$TS_OUTPUT ++grep testuser /etc/passwd >> $TS_OUTPUT ++userdel --remove testuser_chfn_test &> /dev/null ++ts_finalize +-- +2.21.0 + diff --git a/SOURCES/0033-tests-update-lscpu-test-for-RHEL8.patch b/SOURCES/0033-tests-update-lscpu-test-for-RHEL8.patch new file mode 100644 index 0000000..8ba4702 --- /dev/null +++ b/SOURCES/0033-tests-update-lscpu-test-for-RHEL8.patch @@ -0,0 +1,83 @@ +From b30f84e240bd60a23508797e33a4777cbaa50949 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 17 Dec 2019 10:53:47 +0100 +Subject: [PATCH] tests: update lscpu test for RHEL8 + +The test is originally from upstream (~v2.35), but RHEL-8 uses older +version with a little different output -- RHEL-8 has no vulnerability +fields and it counts cache sizes in different way. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1739443 +Signed-off-by: Karel Zak +--- + tests/expected/lscpu/lscpu-s390-nested-virt | 57 ++++++++++----------- + 1 file changed, 26 insertions(+), 31 deletions(-) + +diff --git a/tests/expected/lscpu/lscpu-s390-nested-virt b/tests/expected/lscpu/lscpu-s390-nested-virt +index 2665fd8dc..a6ab04f0b 100644 +--- a/tests/expected/lscpu/lscpu-s390-nested-virt ++++ b/tests/expected/lscpu/lscpu-s390-nested-virt +@@ -1,34 +1,29 @@ +-CPU op-mode(s): 32-bit, 64-bit +-CPU(s): 2 +-On-line CPU(s) list: 0,1 +-Thread(s) per core: 1 +-Core(s) per socket: 1 +-Socket(s) per book: 1 +-Book(s) per drawer: 1 +-Drawer(s): 2 +-NUMA node(s): 1 +-Vendor ID: IBM/S390 +-Machine type: 2964 +-CPU dynamic MHz: 5000 +-CPU static MHz: 5000 +-BogoMIPS: 3033.00 +-Hypervisor: KVM/Linux +-Hypervisor vendor: KVM +-Virtualization type: full +-Dispatching mode: horizontal +-L1d cache: 256 KiB +-L1i cache: 192 KiB +-L2d cache: 4 MiB +-L2i cache: 4 MiB +-L3 cache: 64 MiB +-L4 cache: 480 MiB +-NUMA node0 CPU(s): 0,1 +-Vulnerability L1tf: Not affected +-Vulnerability Meltdown: Not affected +-Vulnerability Spec store bypass: Not affected +-Vulnerability Spectre v1: Mitigation; __user pointer sanitization +-Vulnerability Spectre v2: Mitigation; execute trampolines +-Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx ++CPU op-mode(s): 32-bit, 64-bit ++CPU(s): 2 ++On-line CPU(s) list: 0,1 ++Thread(s) per core: 1 ++Core(s) per socket: 1 ++Socket(s) per book: 1 ++Book(s) per drawer: 1 ++Drawer(s): 2 ++NUMA node(s): 1 ++Vendor ID: IBM/S390 ++Machine type: 2964 ++CPU dynamic MHz: 5000 ++CPU static MHz: 5000 ++BogoMIPS: 3033.00 ++Hypervisor: KVM/Linux ++Hypervisor vendor: KVM ++Virtualization type: full ++Dispatching mode: horizontal ++L1d cache: 128K ++L1i cache: 96K ++L2d cache: 2048K ++L2i cache: 2048K ++L3 cache: 65536K ++L4 cache: 491520K ++NUMA node0 CPU(s): 0,1 ++Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx + + # The following is the parsable format, which can be fed to other + # programs. Each different item in every column has an unique ID +-- +2.21.0 + diff --git a/SOURCES/0034-tests-fdisk-make-sure-we-use-the-same-sizes-for-MD-d.patch b/SOURCES/0034-tests-fdisk-make-sure-we-use-the-same-sizes-for-MD-d.patch new file mode 100644 index 0000000..99cdd50 --- /dev/null +++ b/SOURCES/0034-tests-fdisk-make-sure-we-use-the-same-sizes-for-MD-d.patch @@ -0,0 +1,91 @@ +From 60f97394878d8b540ee6a4fb9c9edaae2f90d0d0 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 17 Dec 2019 18:10:31 +0100 +Subject: [PATCH] tests: (fdisk) make sure we use the same sizes for MD devices + +It seems on some kernels MD can return error if the devices in RAID +have different size + + # mdadm -q --create /dev/md8 --chunk=64 --level=0 --raid-devices=2 /dev/sda1 /dev/sda2 + mdadm: RUN_ARRAY failed: Unknown error 524 + + # dmesg + ... + [ 1485.148435] md/raid0:md8: cannot assemble multi-zone RAID0 with default_layout setting + [ 1485.152306] md/raid0: please set raid.default_layout to 1 or 2 + [ 1485.154050] md: pers->run() failed ... + [ 1485.154104] md: md8 stopped. + +Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1784534 +Signed-off-by: Karel Zak +--- + tests/expected/fdisk/align-512-4K-md | 12 ++++++------ + tests/ts/fdisk/align-512-4K-md | 4 ++-- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md +index caca03154..3690c04c2 100644 +--- a/tests/expected/fdisk/align-512-4K-md ++++ b/tests/expected/fdisk/align-512-4K-md +@@ -16,7 +16,7 @@ Created a new . + Command (m for help): Partition type + p primary (1 primary, 0 extended, 3 free) + e extended (container for logical partitions) +-Select (default p): Partition number (2-4, default 2): First sector (43008-102399, default 43008): Last sector, +sectors or +size{K,M,G,T,P} (43008-102399, default 102399): ++Select (default p): Partition number (2-4, default 2): First sector (51199-102399, default 51200): Last sector, +sectors or +size{K,M,G,T,P} (51200-102399, default 102399): + Created a new . + + Command (m for help): Disk : 50 MiB, 52428800 bytes, 102400 sectors +@@ -27,8 +27,8 @@ Disklabel type: dos + Disk identifier: + + Device Boot Start End Sectors Size Id Type +-1 2048 43007 40960 20M 83 Linux +-2 43008 102399 59392 29M 83 Linux ++1 2048 51198 49151 24M 83 Linux ++2 51200 100350 49151 24M 83 Linux + + Command (m for help): The partition table has been altered. + Calling ioctl() to re-read partition table. +@@ -49,16 +49,16 @@ Created a new . + Command (m for help): Partition type + p primary (0 primary, 0 extended, 4 free) + e extended (container for logical partitions) +-Select (default p): Partition number (1-4, default 1): First sector (2048-100095, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-100095, default 100095): ++Select (default p): Partition number (1-4, default 1): First sector (2048-97791, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-97791, default 97791): + Created a new . + + Command (m for help): Partition type + p primary (1 primary, 0 extended, 3 free) + e extended (container for logical partitions) +-Select (default p): Partition number (2-4, default 2): First sector (22528-100095, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-100095, default 100095): ++Select (default p): Partition number (2-4, default 2): First sector (22528-97791, default 22528): Last sector, +sectors or +size{K,M,G,T,P} (22528-97791, default 97791): + Created a new . + +-Command (m for help): Disk : 48.9 MiB, 51249152 bytes, 100096 sectors ++Command (m for help): Disk : 47.8 MiB, 50069504 bytes, 97792 sectors + Units: sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 4096 bytes + I/O size (minimum/optimal): 65536 bytes / bytes +diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md +index 7f60a654f..68aaff0b7 100755 +--- a/tests/ts/fdisk/align-512-4K-md ++++ b/tests/ts/fdisk/align-512-4K-md +@@ -41,12 +41,12 @@ n + p + 1 + +-+20M +++49150 + n + p + 2 + +- +++49150 + p + w + q +-- +2.21.0 + diff --git a/SOURCES/0035-tests-mark-MD-tests-with-metadata-v0.90-as-KNOWN-FAI.patch b/SOURCES/0035-tests-mark-MD-tests-with-metadata-v0.90-as-KNOWN-FAI.patch new file mode 100644 index 0000000..8759594 --- /dev/null +++ b/SOURCES/0035-tests-mark-MD-tests-with-metadata-v0.90-as-KNOWN-FAI.patch @@ -0,0 +1,80 @@ +From 3fd5c8e78a9758a6fc9310485d2428e300ad3b63 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 11 Jun 2020 10:55:25 +0200 +Subject: [PATCH 35/40] tests: mark MD tests with metadata v0.90 as KNOWN-FAIL + +metadata v0.90 is deprecated thing and unsupported to create by some new +mdadm versions. It's possible to assemble this array (with +default_layout=1 on modprobe raid0), but impossible to create a new +one. + +Upstream: http://github.com/karelzak/util-linux/commit/4ae96cf77b36660255d5870a4209480bbec47902 +Upstream: http://github.com/karelzak/util-linux/commit/7519c3edab120b14623931d5ddb16fdc6e7cad5d +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1826251 +Signed-off-by: Karel Zak +--- + tests/ts/blkid/md-raid0-whole | 3 +++ + tests/ts/blkid/md-raid1-part | 3 +++ + tests/ts/blkid/md-raid1-whole | 3 +++ + tests/ts/fdisk/align-512-4K-md | 3 +++ + 4 files changed, 12 insertions(+) + +diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole +index 45c6ee55b..1f3fc2634 100755 +--- a/tests/ts/blkid/md-raid0-whole ++++ b/tests/ts/blkid/md-raid0-whole +@@ -29,6 +29,9 @@ ts_skip_nonroot + ts_check_losetup + ts_check_prog "mdadm" + ++# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1-12. ++TS_KNOWN_FAIL="yes" ++ + ts_log "Initialize devices" + IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" + +diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part +index 3fa6395b0..3d42aadb8 100755 +--- a/tests/ts/blkid/md-raid1-part ++++ b/tests/ts/blkid/md-raid1-part +@@ -28,6 +28,9 @@ ts_check_test_command "$TS_CMD_BLKID" + ts_skip_nonroot + ts_check_prog "mdadm" + ++# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1-12. ++TS_KNOWN_FAIL="yes" ++ + # set global variable TS_DEVICE + ts_scsi_debug_init dev_size_mb=51 sector_size=512 + +diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole +index ddf4a6934..6eba9cc8e 100755 +--- a/tests/ts/blkid/md-raid1-whole ++++ b/tests/ts/blkid/md-raid1-whole +@@ -29,6 +29,9 @@ ts_skip_nonroot + ts_check_losetup + ts_check_prog "mdadm" + ++# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1-12. ++TS_KNOWN_FAIL="yes" ++ + ts_log "Initialize devices" + IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" + +diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md +index 68aaff0b7..0a8e09bc1 100755 +--- a/tests/ts/fdisk/align-512-4K-md ++++ b/tests/ts/fdisk/align-512-4K-md +@@ -31,6 +31,9 @@ ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot + ts_check_prog "mdadm" + ++# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1-12. ++TS_KNOWN_FAIL="yes" ++ + # set global variable TS_DEVICE + ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3 + DEVNAME=$(basename $TS_DEVICE) +-- +2.25.4 + diff --git a/SOURCES/0036-libblkid-add-BitLocker-detection.patch b/SOURCES/0036-libblkid-add-BitLocker-detection.patch new file mode 100644 index 0000000..993bf9d --- /dev/null +++ b/SOURCES/0036-libblkid-add-BitLocker-detection.patch @@ -0,0 +1,284 @@ +From ae7b79ff8a7fb576c018bc9a7eaf9e135b7b553e Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 24 Apr 2018 10:57:48 +0200 +Subject: [PATCH 36/40] libblkid: add BitLocker detection + +Supported: +* WinVista version +* Win7 and later versions (based on NTFS) +* BitLockerToGo (for removable media; based on FAT32) + +Unfortunately, it's without LABEL and UUID. It seems BitLocker does +not use volume_label and volume_serial stuff from NTFS header. + +Upstream: http://github.com/karelzak/util-linux/commit/136f89ce5ed8cd159a1c56b5a775dada2363ecd3 +Upstream: http://github.com/karelzak/util-linux/commit/47afae0caaa2b3440d6ac812079e3ada5f2aa0bd (bitlocker.c part) +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1812576 +Addresses: https://github.com/karelzak/util-linux/issues/617 +Signed-off-by: Karel Zak +--- + libblkid/src/Makemodule.am | 1 + + libblkid/src/superblocks/bitlocker.c | 191 +++++++++++++++++++++++++ + libblkid/src/superblocks/superblocks.c | 1 + + libblkid/src/superblocks/superblocks.h | 3 + + libblkid/src/superblocks/vfat.c | 3 + + 5 files changed, 199 insertions(+) + create mode 100644 libblkid/src/superblocks/bitlocker.c + +diff --git a/libblkid/src/Makemodule.am b/libblkid/src/Makemodule.am +index 0e1c765fb..ea0230702 100644 +--- a/libblkid/src/Makemodule.am ++++ b/libblkid/src/Makemodule.am +@@ -47,6 +47,7 @@ libblkid_la_SOURCES = \ + libblkid/src/superblocks/bcache.c \ + libblkid/src/superblocks/befs.c \ + libblkid/src/superblocks/bfs.c \ ++ libblkid/src/superblocks/bitlocker.c \ + libblkid/src/superblocks/btrfs.c \ + libblkid/src/superblocks/cramfs.c \ + libblkid/src/superblocks/ddf_raid.c \ +diff --git a/libblkid/src/superblocks/bitlocker.c b/libblkid/src/superblocks/bitlocker.c +new file mode 100644 +index 000000000..111edf39b +--- /dev/null ++++ b/libblkid/src/superblocks/bitlocker.c +@@ -0,0 +1,191 @@ ++/* ++ * Copyright (C) 2018 Karel Zak ++ * ++ * This file may be redistributed under the terms of the ++ * GNU Lesser General Public License. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "superblocks.h" ++ ++#define BDE_HDR_SIZE 512 ++#define BDE_HDR_OFFSET 0 ++ ++struct bde_header_win7 { ++/* 0 */ unsigned char boot_entry_point[3]; ++/* 3 */ unsigned char fs_signature[8]; ++/* 11 */ unsigned char __dummy1[67 - 11]; ++/* 67 */ uint32_t volume_serial; /* NTFS uses 64bit serial number */ ++/* 71 */ unsigned char volume_label[11]; /* "NO NAME\x20\x20\x20\x20" only */ ++/* 82 */ unsigned char __dummy2[160 - 82]; ++/* 160 */ unsigned char guid[16]; /* BitLocker specific GUID */ ++/* 176 */ uint64_t fve_metadata_offset; ++} __attribute__((packed)); ++ ++ ++struct bde_header_togo { ++/* 0 */ unsigned char boot_entry_point[3]; ++/* 3 */ unsigned char fs_signature[8]; ++/* 11 */ unsigned char __dummy[424 - 11]; ++/* 424 */ unsigned char guid[16]; ++/* 440 */ uint64_t fve_metadata_offset; ++} __attribute__((packed)); ++ ++ ++struct bde_fve_metadata { ++/* 0 */ unsigned char signature[8]; ++/* 8 */ uint16_t size; ++/* 10 */ uint16_t version; ++}; ++ ++enum { ++ BDE_VERSION_VISTA = 0, ++ BDE_VERSION_WIN7, ++ BDE_VERSION_TOGO ++}; ++ ++#define BDE_MAGIC_VISTA "\xeb\x52\x90-FVE-FS-" ++#define BDE_MAGIC_WIN7 "\xeb\x58\x90-FVE-FS-" ++#define BDE_MAGIC_TOGO "\xeb\x58\x90MSWIN4.1" ++ ++#define BDE_MAGIC_FVE "-FVE-FS-" ++ ++static int get_bitlocker_type(const unsigned char *buf) ++{ ++ size_t i; ++ static const char *map[] = { ++ [BDE_VERSION_VISTA] = BDE_MAGIC_VISTA, ++ [BDE_VERSION_WIN7] = BDE_MAGIC_WIN7, ++ [BDE_VERSION_TOGO] = BDE_MAGIC_TOGO ++ }; ++ ++ for (i = 0; i < ARRAY_SIZE(map); i++) { ++ if (memcmp(buf, map[i], 11) == 0) ++ return (int) i; ++ } ++ ++ return -1; ++} ++ ++/* Returns: < 0 error, 1 nothing, 0 success ++ */ ++static int get_bitlocker_headers(blkid_probe pr, ++ int *type, ++ const unsigned char **buf_hdr, ++ const unsigned char **buf_fve) ++{ ++ ++ const unsigned char *buf; ++ const struct bde_fve_metadata *fve; ++ uint64_t off = 0; ++ int kind; ++ ++ if (buf_hdr) ++ *buf_hdr = NULL; ++ if (buf_fve) ++ *buf_fve = NULL; ++ if (type) ++ *type = -1; ++ ++ buf = blkid_probe_get_buffer(pr, BDE_HDR_OFFSET, BDE_HDR_SIZE); ++ if (!buf) ++ return errno ? -errno : 1; ++ ++ kind = get_bitlocker_type(buf); ++ ++ /* Check BitLocker header */ ++ switch (kind) { ++ case BDE_VERSION_WIN7: ++ off = le64_to_cpu(((const struct bde_header_win7 *) buf)->fve_metadata_offset); ++ break; ++ case BDE_VERSION_TOGO: ++ off = le64_to_cpu(((const struct bde_header_togo *) buf)->fve_metadata_offset); ++ break; ++ case BDE_VERSION_VISTA: ++ goto done; ++ default: ++ goto nothing; ++ } ++ ++ if (!off) ++ goto nothing; ++ if (buf_hdr) ++ *buf_hdr = buf; ++ ++ /* Check Bitlocker FVE metadata header */ ++ buf = blkid_probe_get_buffer(pr, off, sizeof(struct bde_fve_metadata)); ++ if (!buf) ++ return errno ? -errno : 1; ++ ++ fve = (const struct bde_fve_metadata *) buf; ++ if (memcmp(fve->signature, BDE_MAGIC_FVE, sizeof(fve->signature)) != 0) ++ goto nothing; ++ if (buf_fve) ++ *buf_fve = buf; ++done: ++ if (type) ++ *type = kind; ++ return 0; ++nothing: ++ return 1; ++} ++ ++/* ++ * This is used by vFAT and NTFS prober to avoid collisions with bitlocker. ++ */ ++int blkid_probe_is_bitlocker(blkid_probe pr) ++{ ++ return get_bitlocker_headers(pr, NULL, NULL, NULL) == 0; ++} ++ ++static int probe_bitlocker(blkid_probe pr, ++ const struct blkid_idmag *mag __attribute__((__unused__))) ++{ ++ const unsigned char *buf_fve = NULL; ++ const unsigned char *buf_hdr = NULL; ++ int rc, kind; ++ ++ rc = get_bitlocker_headers(pr, &kind, &buf_hdr, &buf_fve); ++ if (rc) ++ return rc; ++ ++ if (kind == BDE_VERSION_WIN7) { ++ const struct bde_header_win7 *hdr = (const struct bde_header_win7 *) buf_hdr; ++ ++ /* Unfortunately, it seems volume_serial is always zero */ ++ blkid_probe_sprintf_uuid(pr, ++ (const unsigned char *) &hdr->volume_serial, ++ sizeof(hdr->volume_serial), ++ "%016d", le32_to_cpu(hdr->volume_serial)); ++ } ++ ++ if (buf_fve) { ++ const struct bde_fve_metadata *fve = (const struct bde_fve_metadata *) buf_fve; ++ ++ blkid_probe_sprintf_version(pr, "%d", fve->version); ++ } ++ return 0; ++} ++ ++/* See header details: ++ * https://github.com/libyal/libbde/blob/master/documentation/BitLocker%20Drive%20Encryption%20(BDE)%20format.asciidoc ++ */ ++const struct blkid_idinfo bitlocker_idinfo = ++{ ++ .name = "BitLocker", ++ .usage = BLKID_USAGE_CRYPTO, ++ .probefunc = probe_bitlocker, ++ .magics = ++ { ++ { .magic = BDE_MAGIC_VISTA, .len = 11 }, ++ { .magic = BDE_MAGIC_WIN7, .len = 11 }, ++ { .magic = BDE_MAGIC_TOGO, .len = 11 }, ++ { NULL } ++ } ++}; +diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c +index 076541d1a..6dfd2be64 100644 +--- a/libblkid/src/superblocks/superblocks.c ++++ b/libblkid/src/superblocks/superblocks.c +@@ -115,6 +115,7 @@ static const struct blkid_idinfo *idinfos[] = + &ubi_idinfo, + &vdo_idinfo, + &stratis_idinfo, ++ &bitlocker_idinfo, + + /* Filesystems */ + &vfat_idinfo, +diff --git a/libblkid/src/superblocks/superblocks.h b/libblkid/src/superblocks/superblocks.h +index 2723fb1d5..d677f85bc 100644 +--- a/libblkid/src/superblocks/superblocks.h ++++ b/libblkid/src/superblocks/superblocks.h +@@ -81,6 +81,7 @@ extern const struct blkid_idinfo bcache_idinfo; + extern const struct blkid_idinfo mpool_idinfo; + extern const struct blkid_idinfo vdo_idinfo; + extern const struct blkid_idinfo stratis_idinfo; ++extern const struct blkid_idinfo bitlocker_idinfo; + + /* + * superblock functions +@@ -105,4 +106,6 @@ extern int blkid_probe_set_id_label(blkid_probe pr, const char *name, + extern int blkid_probe_set_utf8_id_label(blkid_probe pr, const char *name, + unsigned char *data, size_t len, int enc); + ++extern int blkid_probe_is_bitlocker(blkid_probe pr); ++ + #endif /* _BLKID_SUPERBLOCKS_H */ +diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c +index 3aeba018a..29b3c501c 100644 +--- a/libblkid/src/superblocks/vfat.c ++++ b/libblkid/src/superblocks/vfat.c +@@ -268,6 +268,9 @@ static int fat_valid_superblock(blkid_probe pr, + } + } + ++ if (blkid_probe_is_bitlocker(pr)) ++ return 0; ++ + return 1; /* valid */ + } + +-- +2.25.4 + diff --git a/SOURCES/0037-blkid-retport-block-size-of-a-filesystem.patch b/SOURCES/0037-blkid-retport-block-size-of-a-filesystem.patch new file mode 100644 index 0000000..2795684 --- /dev/null +++ b/SOURCES/0037-blkid-retport-block-size-of-a-filesystem.patch @@ -0,0 +1,1121 @@ +From 9e9355c71c031f4d7445c30cb39bd6b33c10ff9d Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Mon, 2 Sep 2019 12:28:39 +0200 +Subject: [PATCH 37/40] blkid: retport block size of a filesystem + +This patch extends libblkid, so that it reports filesystem block size. + +When blkid returns a specific number in the BLOCK_SIZE attribute, it +guarantees that all the bios submitted by the filesystem are aligned on +this boundary. + +We need this because when we want to enable dm-integrity or dm-writecache +on an existing filesystem, we need to know filesystem block size, so that +dm-integrity or dm-writecache is initialized with matching block size. + +We could always use block size 512 for dm-integrity and dm-writecache, but +that would cause metadata overhead and performance degradation. On the +other hand, if we used block size 4096, it would fail if the filesystem +has smaller blocksize. + +[kzak@redhat.com: - move vfat BLOCK_SIZE to probing function + - remove unwanted debug fprintf from ZFS prober] + +RHEL-8.3: add regression tests updates to teh patch too + +Upstream: http://github.com/karelzak/util-linux/commit/cd129b7d2fecd5f2013512936de2db1bf244aa75 +Upstream: http://github.com/karelzak/util-linux/commit/e7d318a9dd63c9fae8f07754ce12aa9af4dce089 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1817726 +Signed-off-by: Mikulas Patocka +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/befs.c | 3 + + libblkid/src/superblocks/btrfs.c | 1 + + libblkid/src/superblocks/exfat.c | 2 + + libblkid/src/superblocks/exfs.c | 4 + + libblkid/src/superblocks/ext.c | 3 + + libblkid/src/superblocks/f2fs.c | 2 + + libblkid/src/superblocks/gfs.c | 1 + + libblkid/src/superblocks/hfs.c | 2 + + libblkid/src/superblocks/hpfs.c | 1 + + libblkid/src/superblocks/iso9660.c | 2 + + libblkid/src/superblocks/jfs.c | 1 + + libblkid/src/superblocks/minix.c | 5 ++ + libblkid/src/superblocks/nilfs.c | 3 + + libblkid/src/superblocks/ntfs.c | 2 + + libblkid/src/superblocks/ocfs.c | 3 + + libblkid/src/superblocks/reiserfs.c | 10 ++- + libblkid/src/superblocks/romfs.c | 3 + + libblkid/src/superblocks/squashfs.c | 2 + + libblkid/src/superblocks/superblocks.c | 7 ++ + libblkid/src/superblocks/superblocks.h | 2 + + libblkid/src/superblocks/udf.c | 2 + + libblkid/src/superblocks/ufs.c | 5 ++ + libblkid/src/superblocks/vfat.c | 2 + + libblkid/src/superblocks/vxfs.c | 18 ++++- + libblkid/src/superblocks/xfs.c | 1 + + libblkid/src/superblocks/zfs.c | 74 ++++++++++++++----- + tests/expected/blkid/low-probe-befs | 1 + + tests/expected/blkid/low-probe-exfat | 1 + + tests/expected/blkid/low-probe-ext2 | 1 + + tests/expected/blkid/low-probe-ext3 | 1 + + tests/expected/blkid/low-probe-f2fs | 1 + + tests/expected/blkid/low-probe-fat | 1 + + tests/expected/blkid/low-probe-fat16_noheads | 1 + + .../blkid/low-probe-fat32_cp850_O_tilde | 1 + + .../expected/blkid/low-probe-fat32_label_64MB | 1 + + tests/expected/blkid/low-probe-gfs2 | 1 + + tests/expected/blkid/low-probe-hfsplus | 1 + + tests/expected/blkid/low-probe-hpfs | 1 + + tests/expected/blkid/low-probe-iso | 1 + + tests/expected/blkid/low-probe-iso-joliet | 1 + + tests/expected/blkid/low-probe-iso-rr-joliet | 1 + + tests/expected/blkid/low-probe-jbd | 1 + + tests/expected/blkid/low-probe-jfs | 1 + + tests/expected/blkid/low-probe-minix-BE | 1 + + tests/expected/blkid/low-probe-minix-LE | 1 + + tests/expected/blkid/low-probe-nilfs2 | 1 + + tests/expected/blkid/low-probe-ntfs | 1 + + tests/expected/blkid/low-probe-ocfs2 | 1 + + tests/expected/blkid/low-probe-reiser3 | 1 + + tests/expected/blkid/low-probe-reiser4 | 1 + + tests/expected/blkid/low-probe-romfs | 1 + + tests/expected/blkid/low-probe-small-fat32 | 1 + + tests/expected/blkid/low-probe-udf | 1 + + .../blkid/low-probe-udf-bdr-2.60-nero | 1 + + .../blkid/low-probe-udf-cd-mkudfiso-20100208 | 1 + + tests/expected/blkid/low-probe-udf-cd-nero-6 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-1 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-2 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-3 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-4 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-5 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-6 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-7 | 1 + + .../blkid/low-probe-udf-hdd-mkudffs-1.3-8 | 1 + + .../blkid/low-probe-udf-hdd-udfclient-0.7.5 | 1 + + .../blkid/low-probe-udf-hdd-udfclient-0.7.7 | 1 + + tests/expected/blkid/low-probe-udf-hdd-win7 | 1 + + tests/expected/blkid/low-probe-ufs | 1 + + tests/expected/blkid/low-probe-xfs | 1 + + tests/expected/blkid/low-probe-zfs | 1 + + 72 files changed, 186 insertions(+), 21 deletions(-) + +diff --git a/libblkid/src/superblocks/befs.c b/libblkid/src/superblocks/befs.c +index 14af97217..516d80093 100644 +--- a/libblkid/src/superblocks/befs.c ++++ b/libblkid/src/superblocks/befs.c +@@ -519,6 +519,9 @@ static int probe_befs(blkid_probe pr, const struct blkid_idmag *mag) + blkid_probe_sprintf_uuid(pr, (unsigned char *) &volume_id, + sizeof(volume_id), "%016" PRIx64, + FS64_TO_CPU(volume_id, fs_le)); ++ ++ blkid_probe_set_block_size(pr, block_size); ++ + return BLKID_PROBE_OK; + } + +diff --git a/libblkid/src/superblocks/btrfs.c b/libblkid/src/superblocks/btrfs.c +index 7ce3dfff8..f0fde700d 100644 +--- a/libblkid/src/superblocks/btrfs.c ++++ b/libblkid/src/superblocks/btrfs.c +@@ -74,6 +74,7 @@ static int probe_btrfs(blkid_probe pr, const struct blkid_idmag *mag) + + blkid_probe_set_uuid(pr, bfs->fsid); + blkid_probe_set_uuid_as(pr, bfs->dev_item.uuid, "UUID_SUB"); ++ blkid_probe_set_block_size(pr, le32_to_cpu(bfs->sectorsize)); + + return 0; + } +diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c +index 4bf92eac8..7622320d3 100644 +--- a/libblkid/src/superblocks/exfat.c ++++ b/libblkid/src/superblocks/exfat.c +@@ -137,6 +137,8 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag) + blkid_probe_sprintf_version(pr, "%u.%u", + sb->version.vermaj, sb->version.vermin); + ++ blkid_probe_set_block_size(pr, BLOCK_SIZE(sb)); ++ + return BLKID_PROBE_OK; + } + +diff --git a/libblkid/src/superblocks/exfs.c b/libblkid/src/superblocks/exfs.c +index f717b6530..e0eafafc6 100644 +--- a/libblkid/src/superblocks/exfs.c ++++ b/libblkid/src/superblocks/exfs.c +@@ -170,7 +170,11 @@ static int probe_exfs(blkid_probe pr, const struct blkid_idmag *mag) + if (*xs->sb_fname != '\0') + blkid_probe_set_label(pr, (unsigned char *) xs->sb_fname, + sizeof(xs->sb_fname)); ++ + blkid_probe_set_uuid(pr, xs->sb_uuid); ++ ++ blkid_probe_set_block_size(pr, be32_to_cpu(xs->sb_blocksize)); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/ext.c b/libblkid/src/superblocks/ext.c +index caf82c171..3870522fa 100644 +--- a/libblkid/src/superblocks/ext.c ++++ b/libblkid/src/superblocks/ext.c +@@ -187,6 +187,9 @@ static void ext_get_info(blkid_probe pr, int ver, struct ext2_super_block *es) + blkid_probe_sprintf_version(pr, "%u.%u", + le32_to_cpu(es->s_rev_level), + le16_to_cpu(es->s_minor_rev_level)); ++ ++ if (le32_to_cpu(es->s_log_block_size) < 32) ++ blkid_probe_set_block_size(pr, 1024U << le32_to_cpu(es->s_log_block_size)); + } + + +diff --git a/libblkid/src/superblocks/f2fs.c b/libblkid/src/superblocks/f2fs.c +index d1bf25a3a..255ef6384 100644 +--- a/libblkid/src/superblocks/f2fs.c ++++ b/libblkid/src/superblocks/f2fs.c +@@ -78,6 +78,8 @@ 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_block_size(pr, 1U << le32_to_cpu(sb->log_blocksize)); + return 0; + } + +diff --git a/libblkid/src/superblocks/gfs.c b/libblkid/src/superblocks/gfs.c +index ea6036cb7..e22a6a3f9 100644 +--- a/libblkid/src/superblocks/gfs.c ++++ b/libblkid/src/superblocks/gfs.c +@@ -98,6 +98,7 @@ static int probe_gfs2(blkid_probe pr, const struct blkid_idmag *mag) + sizeof(sbd->sb_locktable)); + blkid_probe_set_uuid(pr, sbd->sb_uuid); + blkid_probe_set_version(pr, "1"); ++ blkid_probe_set_block_size(pr, be32_to_cpu(sbd->sb_bsize)); + return 0; + } + return 1; +diff --git a/libblkid/src/superblocks/hfs.c b/libblkid/src/superblocks/hfs.c +index 7b0117405..185c42c92 100644 +--- a/libblkid/src/superblocks/hfs.c ++++ b/libblkid/src/superblocks/hfs.c +@@ -241,6 +241,8 @@ static int probe_hfsplus(blkid_probe pr, const struct blkid_idmag *mag) + if (blocksize < HFSPLUS_SECTOR_SIZE) + return 1; + ++ blkid_probe_set_block_size(pr, blocksize); ++ + memcpy(extents, hfsplus->cat_file.extents, sizeof(extents)); + cat_block = be32_to_cpu(extents[0].start_block); + +diff --git a/libblkid/src/superblocks/hpfs.c b/libblkid/src/superblocks/hpfs.c +index 0565d370c..dcf4520b6 100644 +--- a/libblkid/src/superblocks/hpfs.c ++++ b/libblkid/src/superblocks/hpfs.c +@@ -99,6 +99,7 @@ static int probe_hpfs(blkid_probe pr, const struct blkid_idmag *mag) + hbb->vol_serno[1], hbb->vol_serno[0]); + } + blkid_probe_sprintf_version(pr, "%u", version); ++ blkid_probe_set_block_size(pr, 512); + + return 0; + } +diff --git a/libblkid/src/superblocks/iso9660.c b/libblkid/src/superblocks/iso9660.c +index 7356754ee..8dc2e5394 100644 +--- a/libblkid/src/superblocks/iso9660.c ++++ b/libblkid/src/superblocks/iso9660.c +@@ -182,6 +182,8 @@ static int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag) + + memcpy(label, iso->volume_id, sizeof(label)); + ++ blkid_probe_set_block_size(pr, 2048); ++ + if (!is_str_empty(iso->system_id, sizeof(iso->system_id))) + blkid_probe_set_id_label(pr, "SYSTEM_ID", + iso->system_id, sizeof(iso->system_id)); +diff --git a/libblkid/src/superblocks/jfs.c b/libblkid/src/superblocks/jfs.c +index 0f956ef00..3de8c2e3d 100644 +--- a/libblkid/src/superblocks/jfs.c ++++ b/libblkid/src/superblocks/jfs.c +@@ -52,6 +52,7 @@ static int probe_jfs(blkid_probe pr, const struct blkid_idmag *mag) + if (*((char *) js->js_label) != '\0') + blkid_probe_set_label(pr, js->js_label, sizeof(js->js_label)); + blkid_probe_set_uuid(pr, js->js_uuid); ++ blkid_probe_set_block_size(pr, le32_to_cpu(js->js_bsize)); + return 0; + } + +diff --git a/libblkid/src/superblocks/minix.c b/libblkid/src/superblocks/minix.c +index c47378d73..674a1f17b 100644 +--- a/libblkid/src/superblocks/minix.c ++++ b/libblkid/src/superblocks/minix.c +@@ -80,6 +80,7 @@ static int probe_minix(blkid_probe pr, + unsigned long zones, ninodes, imaps, zmaps; + off_t firstz; + size_t zone_size; ++ unsigned block_size; + + data = blkid_probe_get_buffer(pr, 1024, + max(sizeof(struct minix_super_block), +@@ -103,6 +104,7 @@ static int probe_minix(blkid_probe pr, + zmaps = minix_swab16(swabme, sb->s_zmap_blocks); + firstz = minix_swab16(swabme, sb->s_firstdatazone); + zone_size = sb->s_log_zone_size; ++ block_size = 1024; + break; + } + case 3: { +@@ -114,6 +116,8 @@ static int probe_minix(blkid_probe pr, + zmaps = minix_swab16(swabme, sb->s_zmap_blocks); + firstz = minix_swab16(swabme, sb->s_firstdatazone); + zone_size = sb->s_log_zone_size; ++ block_size = minix_swab16(swabme, sb->s_blocksize); ++ + break; + } + default: +@@ -143,6 +147,7 @@ static int probe_minix(blkid_probe pr, + return 1; + + blkid_probe_sprintf_version(pr, "%d", version); ++ blkid_probe_set_block_size(pr, block_size); + return 0; + } + +diff --git a/libblkid/src/superblocks/nilfs.c b/libblkid/src/superblocks/nilfs.c +index 95538ef7b..423bd1ac4 100644 +--- a/libblkid/src/superblocks/nilfs.c ++++ b/libblkid/src/superblocks/nilfs.c +@@ -157,6 +157,9 @@ static int probe_nilfs2(blkid_probe pr, + (unsigned char *) &sb->s_magic)) + return 1; + ++ if (le32_to_cpu(sb->s_log_block_size) < 32) ++ blkid_probe_set_block_size(pr, 1024U << le32_to_cpu(sb->s_log_block_size)); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/ntfs.c b/libblkid/src/superblocks/ntfs.c +index 32973095b..5bfebbb78 100644 +--- a/libblkid/src/superblocks/ntfs.c ++++ b/libblkid/src/superblocks/ntfs.c +@@ -206,6 +206,8 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag) + attr_off += attr_len; + } + ++ blkid_probe_set_block_size(pr, sector_size); ++ + blkid_probe_sprintf_uuid(pr, + (unsigned char *) &ns->volume_serial, + sizeof(ns->volume_serial), +diff --git a/libblkid/src/superblocks/ocfs.c b/libblkid/src/superblocks/ocfs.c +index 3fe199d3f..463ed7bcf 100644 +--- a/libblkid/src/superblocks/ocfs.c ++++ b/libblkid/src/superblocks/ocfs.c +@@ -153,6 +153,9 @@ static int probe_ocfs2(blkid_probe pr, const struct blkid_idmag *mag) + le16_to_cpu(osb->s_major_rev_level), + le16_to_cpu(osb->s_minor_rev_level)); + ++ if (le32_to_cpu(osb->s_blocksize_bits) < 32) ++ blkid_probe_set_block_size(pr, 1U << le32_to_cpu(osb->s_blocksize_bits)); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/reiserfs.c b/libblkid/src/superblocks/reiserfs.c +index edbaaa946..6c5e5b0d7 100644 +--- a/libblkid/src/superblocks/reiserfs.c ++++ b/libblkid/src/superblocks/reiserfs.c +@@ -32,7 +32,8 @@ struct reiserfs_super_block { + + struct reiser4_super_block { + unsigned char rs4_magic[16]; +- uint16_t rs4_dummy[2]; ++ uint8_t rs4_dummy[3]; ++ uint8_t rs4_blocksize; + unsigned char rs4_uuid[16]; + unsigned char rs4_label[16]; + uint64_t rs4_dummy2; +@@ -73,22 +74,29 @@ static int probe_reiser(blkid_probe pr, const struct blkid_idmag *mag) + else + blkid_probe_set_version(pr, "3.5"); + ++ blkid_probe_set_block_size(pr, blocksize); ++ + return 0; + } + + static int probe_reiser4(blkid_probe pr, const struct blkid_idmag *mag) + { + struct reiser4_super_block *rs4; ++ unsigned int blocksize; + + rs4 = blkid_probe_get_sb(pr, mag, struct reiser4_super_block); + if (!rs4) + return errno ? -errno : 1; + ++ blocksize = rs4->rs4_blocksize * 256; ++ + if (*rs4->rs4_label) + blkid_probe_set_label(pr, rs4->rs4_label, sizeof(rs4->rs4_label)); + blkid_probe_set_uuid(pr, rs4->rs4_uuid); + blkid_probe_set_version(pr, "4"); + ++ blkid_probe_set_block_size(pr, blocksize); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/romfs.c b/libblkid/src/superblocks/romfs.c +index f3e9f8b05..1c2ac4315 100644 +--- a/libblkid/src/superblocks/romfs.c ++++ b/libblkid/src/superblocks/romfs.c +@@ -34,6 +34,9 @@ static int probe_romfs(blkid_probe pr, const struct blkid_idmag *mag) + if (*((char *) ros->ros_volume) != '\0') + blkid_probe_set_label(pr, ros->ros_volume, + sizeof(ros->ros_volume)); ++ ++ blkid_probe_set_block_size(pr, 1024); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/squashfs.c b/libblkid/src/superblocks/squashfs.c +index 7364beca2..4db842493 100644 +--- a/libblkid/src/superblocks/squashfs.c ++++ b/libblkid/src/superblocks/squashfs.c +@@ -71,6 +71,8 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag) + + blkid_probe_sprintf_version(pr, "%u.%u", vermaj, vermin); + ++ blkid_probe_set_block_size(pr, 1024); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c +index 6dfd2be64..a86a055fe 100644 +--- a/libblkid/src/superblocks/superblocks.c ++++ b/libblkid/src/superblocks/superblocks.c +@@ -74,6 +74,8 @@ + * @APPLICATION_ID: ISO9660 application identifier + * + * @BOOT_SYSTEM_ID: ISO9660 boot system identifier ++ * ++ * @BLOCK_SIZE: block size + */ + + static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn); +@@ -550,6 +552,11 @@ int blkid_probe_sprintf_version(blkid_probe pr, const char *fmt, ...) + return rc; + } + ++int blkid_probe_set_block_size(blkid_probe pr, unsigned block_size) ++{ ++ return blkid_probe_sprintf_value(pr, "BLOCK_SIZE", "%u", block_size); ++} ++ + static int blkid_probe_set_usage(blkid_probe pr, int usage) + { + struct blkid_chain *chn = blkid_probe_get_chain(pr); +diff --git a/libblkid/src/superblocks/superblocks.h b/libblkid/src/superblocks/superblocks.h +index d677f85bc..d09046cfd 100644 +--- a/libblkid/src/superblocks/superblocks.h ++++ b/libblkid/src/superblocks/superblocks.h +@@ -106,6 +106,8 @@ extern int blkid_probe_set_id_label(blkid_probe pr, const char *name, + extern int blkid_probe_set_utf8_id_label(blkid_probe pr, const char *name, + unsigned char *data, size_t len, int enc); + ++int blkid_probe_set_block_size(blkid_probe pr, unsigned block_size); ++ + extern int blkid_probe_is_bitlocker(blkid_probe pr); + + #endif /* _BLKID_SUPERBLOCKS_H */ +diff --git a/libblkid/src/superblocks/udf.c b/libblkid/src/superblocks/udf.c +index 97e79dab0..1ab8a1e26 100644 +--- a/libblkid/src/superblocks/udf.c ++++ b/libblkid/src/superblocks/udf.c +@@ -464,6 +464,8 @@ real_blksz: + * E.g. number 0x0150 is revision 1.50, number 0x0201 is revision 2.01. */ + blkid_probe_sprintf_version(pr, "%x.%02x", (unsigned int)(udf_rev >> 8), (unsigned int)(udf_rev & 0xFF)); + ++ blkid_probe_set_block_size(pr, bs); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/ufs.c b/libblkid/src/superblocks/ufs.c +index 6ef2acddc..7a8396c1c 100644 +--- a/libblkid/src/superblocks/ufs.c ++++ b/libblkid/src/superblocks/ufs.c +@@ -233,6 +233,11 @@ found: + (unsigned char *) &ufs->fs_magic)) + return 1; + ++ if (!is_be) ++ blkid_probe_set_block_size(pr, le32_to_cpu(ufs->fs_fsize)); ++ else ++ blkid_probe_set_block_size(pr, be32_to_cpu(ufs->fs_fsize)); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c +index 29b3c501c..4e93a0e41 100644 +--- a/libblkid/src/superblocks/vfat.c ++++ b/libblkid/src/superblocks/vfat.c +@@ -436,6 +436,8 @@ static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag) + if (version) + blkid_probe_set_version(pr, version); + ++ blkid_probe_set_block_size(pr, sector_size); ++ + return 0; + } + +diff --git a/libblkid/src/superblocks/vxfs.c b/libblkid/src/superblocks/vxfs.c +index 19d284cbf..d9d26adcf 100644 +--- a/libblkid/src/superblocks/vxfs.c ++++ b/libblkid/src/superblocks/vxfs.c +@@ -12,6 +12,15 @@ + struct vxfs_super_block { + uint32_t vs_magic; + int32_t vs_version; ++ uint32_t vs_ctime; ++ uint32_t vs_cutime; ++ uint32_t __unused1; ++ uint32_t __unused2; ++ uint32_t vs_old_logstart; ++ uint32_t vs_old_logend; ++ uint32_t vs_bsize; ++ uint32_t vs_size; ++ uint32_t vs_dsize; + }; + + static int probe_vxfs(blkid_probe pr, const struct blkid_idmag *mag) +@@ -22,7 +31,13 @@ static int probe_vxfs(blkid_probe pr, const struct blkid_idmag *mag) + if (!vxs) + return errno ? -errno : 1; + +- blkid_probe_sprintf_version(pr, "%u", (unsigned int) vxs->vs_version); ++ if (le32_to_cpu(vxs->vs_magic) == 0xa501fcf5) { ++ blkid_probe_sprintf_version(pr, "%u", (unsigned int)le32_to_cpu(vxs->vs_version)); ++ blkid_probe_set_block_size(pr, le32_to_cpu(vxs->vs_bsize)); ++ } else if (be32_to_cpu(vxs->vs_magic) == 0xa501fcf5) { ++ blkid_probe_sprintf_version(pr, "%u", (unsigned int)be32_to_cpu(vxs->vs_version)); ++ blkid_probe_set_block_size(pr, be32_to_cpu(vxs->vs_bsize)); ++ } + return 0; + } + +@@ -35,6 +50,7 @@ const struct blkid_idinfo vxfs_idinfo = + .magics = + { + { .magic = "\365\374\001\245", .len = 4, .kboff = 1 }, ++ { .magic = "\245\001\374\365", .len = 4, .kboff = 8 }, + { NULL } + } + }; +diff --git a/libblkid/src/superblocks/xfs.c b/libblkid/src/superblocks/xfs.c +index 99848f900..eb513ac3e 100644 +--- a/libblkid/src/superblocks/xfs.c ++++ b/libblkid/src/superblocks/xfs.c +@@ -173,6 +173,7 @@ static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag) + blkid_probe_set_label(pr, (unsigned char *) xs->sb_fname, + sizeof(xs->sb_fname)); + blkid_probe_set_uuid(pr, xs->sb_uuid); ++ blkid_probe_set_block_size(pr, xs->sb_sectsize * 256); + return 0; + } + +diff --git a/libblkid/src/superblocks/zfs.c b/libblkid/src/superblocks/zfs.c +index ec3e1c5bf..cc779c02a 100644 +--- a/libblkid/src/superblocks/zfs.c ++++ b/libblkid/src/superblocks/zfs.c +@@ -37,6 +37,7 @@ struct zfs_uberblock { + + #define DATA_TYPE_UINT64 8 + #define DATA_TYPE_STRING 9 ++#define DATA_TYPE_DIRECTORY 19 + + struct nvpair { + uint32_t nvp_size; +@@ -60,32 +61,37 @@ struct nvuint64 { + uint64_t nvu_value; + }; + ++struct nvdirectory { ++ uint32_t nvd_type; ++ uint32_t nvd_unknown[3]; ++}; ++ + struct nvlist { + uint32_t nvl_unknown[3]; + struct nvpair nvl_nvpair; + }; + +-static int zfs_process_value(blkid_probe pr, char *name, size_t namelen, +- void *value, size_t max_value_size) ++static void zfs_process_value(blkid_probe pr, char *name, size_t namelen, ++ void *value, size_t max_value_size, unsigned directory_level) + { + if (strncmp(name, "name", namelen) == 0 && +- sizeof(struct nvstring) <= max_value_size) { ++ sizeof(struct nvstring) <= max_value_size && ++ !directory_level) { + struct nvstring *nvs = value; + uint32_t nvs_type = be32_to_cpu(nvs->nvs_type); + uint32_t nvs_strlen = be32_to_cpu(nvs->nvs_strlen); + + if (nvs_type != DATA_TYPE_STRING || + (uint64_t)nvs_strlen + sizeof(*nvs) > max_value_size) +- return 0; ++ return; + + DBG(LOWPROBE, ul_debug("nvstring: type %u string %*s\n", + nvs_type, nvs_strlen, nvs->nvs_string)); + + blkid_probe_set_label(pr, nvs->nvs_string, nvs_strlen); +- +- return 1; + } else if (strncmp(name, "guid", namelen) == 0 && +- sizeof(struct nvuint64) <= max_value_size) { ++ sizeof(struct nvuint64) <= max_value_size && ++ !directory_level) { + struct nvuint64 *nvu = value; + uint32_t nvu_type = be32_to_cpu(nvu->nvu_type); + uint64_t nvu_value; +@@ -94,17 +100,16 @@ static int zfs_process_value(blkid_probe pr, char *name, size_t namelen, + nvu_value = be64_to_cpu(nvu_value); + + if (nvu_type != DATA_TYPE_UINT64) +- return 0; ++ return; + + DBG(LOWPROBE, ul_debug("nvuint64: type %u value %"PRIu64"\n", + nvu_type, nvu_value)); + + blkid_probe_sprintf_value(pr, "UUID_SUB", + "%"PRIu64, nvu_value); +- +- return 1; + } else if (strncmp(name, "pool_guid", namelen) == 0 && +- sizeof(struct nvuint64) <= max_value_size) { ++ sizeof(struct nvuint64) <= max_value_size && ++ !directory_level) { + struct nvuint64 *nvu = value; + uint32_t nvu_type = be32_to_cpu(nvu->nvu_type); + uint64_t nvu_value; +@@ -113,7 +118,7 @@ static int zfs_process_value(blkid_probe pr, char *name, size_t namelen, + nvu_value = be64_to_cpu(nvu_value); + + if (nvu_type != DATA_TYPE_UINT64) +- return 0; ++ return; + + DBG(LOWPROBE, ul_debug("nvuint64: type %u value %"PRIu64"\n", + nvu_type, nvu_value)); +@@ -121,10 +126,21 @@ static int zfs_process_value(blkid_probe pr, char *name, size_t namelen, + blkid_probe_sprintf_uuid(pr, (unsigned char *) &nvu_value, + sizeof(nvu_value), + "%"PRIu64, nvu_value); +- return 1; +- } ++ } else if (strncmp(name, "ashift", namelen) == 0 && ++ sizeof(struct nvuint64) <= max_value_size) { ++ struct nvuint64 *nvu = value; ++ uint32_t nvu_type = be32_to_cpu(nvu->nvu_type); ++ uint64_t nvu_value; + +- return 0; ++ memcpy(&nvu_value, &nvu->nvu_value, sizeof(nvu_value)); ++ nvu_value = be64_to_cpu(nvu_value); ++ ++ if (nvu_type != DATA_TYPE_UINT64) ++ return; ++ ++ if (nvu_value < 32) ++ blkid_probe_set_block_size(pr, 1U << nvu_value); ++ } + } + + static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) +@@ -133,7 +149,7 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) + struct nvlist *nvl; + struct nvpair *nvp; + size_t left = 4096; +- int found = 0; ++ unsigned directory_level = 0; + + offset = (offset & ~(VDEV_LABEL_SIZE - 1)) + VDEV_LABEL_NVPAIR; + +@@ -152,13 +168,21 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) + nvp = &nvl->nvl_nvpair; + left -= (unsigned char *)nvp - p; /* Already used up 12 bytes */ + +- while (left > sizeof(*nvp) && nvp->nvp_size != 0 && found < 3) { ++ while (left > sizeof(*nvp)) { + uint32_t nvp_size = be32_to_cpu(nvp->nvp_size); + uint32_t nvp_namelen = be32_to_cpu(nvp->nvp_namelen); + uint64_t namesize = ((uint64_t)nvp_namelen + 3) & ~3; + size_t max_value_size; + void *value; + ++ if (!nvp->nvp_size) { ++ if (!directory_level) ++ break; ++ directory_level--; ++ nvp_size = 8; ++ goto cont; ++ } ++ + DBG(LOWPROBE, ul_debug("left %zd nvp_size %u\n", + left, nvp_size)); + +@@ -174,9 +198,21 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) + max_value_size = nvp_size - (namesize + sizeof(*nvp)); + value = nvp->nvp_name + namesize; + +- found += zfs_process_value(pr, nvp->nvp_name, nvp_namelen, +- value, max_value_size); ++ if (sizeof(struct nvdirectory) <= max_value_size) { ++ struct nvdirectory *nvu = value; ++ if (be32_to_cpu(nvu->nvd_type) == DATA_TYPE_DIRECTORY) { ++ nvp_size = sizeof(*nvp) + namesize + sizeof(*nvu); ++ directory_level++; ++ goto cont; ++ } ++ } ++ ++ zfs_process_value(pr, nvp->nvp_name, nvp_namelen, ++ value, max_value_size, directory_level); + ++cont: ++ if (nvp_size > left) ++ break; + left -= nvp_size; + + nvp = (struct nvpair *)((char *)nvp + nvp_size); +diff --git a/tests/expected/blkid/low-probe-befs b/tests/expected/blkid/low-probe-befs +index b7f25cdd2..5717049d2 100644 +--- a/tests/expected/blkid/low-probe-befs ++++ b/tests/expected/blkid/low-probe-befs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=befs_test + ID_FS_LABEL_ENC=befs_test + ID_FS_TYPE=befs +diff --git a/tests/expected/blkid/low-probe-exfat b/tests/expected/blkid/low-probe-exfat +index b9defbdf9..59cb35225 100644 +--- a/tests/expected/blkid/low-probe-exfat ++++ b/tests/expected/blkid/low-probe-exfat +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=Новый_том + ID_FS_LABEL_ENC=Новый\x20том + ID_FS_TYPE=exfat +diff --git a/tests/expected/blkid/low-probe-ext2 b/tests/expected/blkid/low-probe-ext2 +index c70b85698..087da97a4 100644 +--- a/tests/expected/blkid/low-probe-ext2 ++++ b/tests/expected/blkid/low-probe-ext2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=test-ext2 + ID_FS_LABEL_ENC=test-ext2 + ID_FS_TYPE=ext2 +diff --git a/tests/expected/blkid/low-probe-ext3 b/tests/expected/blkid/low-probe-ext3 +index 4bac43f57..8684884c1 100644 +--- a/tests/expected/blkid/low-probe-ext3 ++++ b/tests/expected/blkid/low-probe-ext3 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=test-ext3 + ID_FS_LABEL_ENC=test-ext3 + ID_FS_SEC_TYPE=ext2 +diff --git a/tests/expected/blkid/low-probe-f2fs b/tests/expected/blkid/low-probe-f2fs +index ee328640e..272905125 100644 +--- a/tests/expected/blkid/low-probe-f2fs ++++ b/tests/expected/blkid/low-probe-f2fs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=test-f2fs + ID_FS_LABEL_ENC=test-f2fs + ID_FS_TYPE=f2fs +diff --git a/tests/expected/blkid/low-probe-fat b/tests/expected/blkid/low-probe-fat +index 420121117..75f99434d 100644 +--- a/tests/expected/blkid/low-probe-fat ++++ b/tests/expected/blkid/low-probe-fat +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=TEST-FAT + ID_FS_LABEL_ENC=TEST-FAT + ID_FS_SEC_TYPE=msdos +diff --git a/tests/expected/blkid/low-probe-fat16_noheads b/tests/expected/blkid/low-probe-fat16_noheads +index ba47078d2..ff9ef2e69 100644 +--- a/tests/expected/blkid/low-probe-fat16_noheads ++++ b/tests/expected/blkid/low-probe-fat16_noheads +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=VTech_1070 + ID_FS_LABEL_ENC=VTech\x201070 + ID_FS_SEC_TYPE=msdos +diff --git a/tests/expected/blkid/low-probe-fat32_cp850_O_tilde b/tests/expected/blkid/low-probe-fat32_cp850_O_tilde +index 096bcbf2c..9ce58e3d9 100644 +--- a/tests/expected/blkid/low-probe-fat32_cp850_O_tilde ++++ b/tests/expected/blkid/low-probe-fat32_cp850_O_tilde +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=___ + ID_FS_LABEL_ENC=\xe5\xe5\xe5 + ID_FS_TYPE=vfat +diff --git a/tests/expected/blkid/low-probe-fat32_label_64MB b/tests/expected/blkid/low-probe-fat32_label_64MB +index 1179490cf..4a99f8ff6 100644 +--- a/tests/expected/blkid/low-probe-fat32_label_64MB ++++ b/tests/expected/blkid/low-probe-fat32_label_64MB +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=BINGO + ID_FS_LABEL_ENC=BINGO + ID_FS_TYPE=vfat +diff --git a/tests/expected/blkid/low-probe-gfs2 b/tests/expected/blkid/low-probe-gfs2 +index cd5a664b4..f04529bc0 100644 +--- a/tests/expected/blkid/low-probe-gfs2 ++++ b/tests/expected/blkid/low-probe-gfs2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=mycluster:mygfs2 + ID_FS_LABEL_ENC=mycluster:mygfs2 + ID_FS_TYPE=gfs2 +diff --git a/tests/expected/blkid/low-probe-hfsplus b/tests/expected/blkid/low-probe-hfsplus +index f54b59f11..cc351a042 100644 +--- a/tests/expected/blkid/low-probe-hfsplus ++++ b/tests/expected/blkid/low-probe-hfsplus +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=123456789ABCDE + ID_FS_LABEL_ENC=123456789ABCDE + ID_FS_TYPE=hfsplus +diff --git a/tests/expected/blkid/low-probe-hpfs b/tests/expected/blkid/low-probe-hpfs +index 47ae1af28..7e4a12b97 100644 +--- a/tests/expected/blkid/low-probe-hpfs ++++ b/tests/expected/blkid/low-probe-hpfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=P01_S16A + ID_FS_LABEL_ENC=P01\x20S16A + ID_FS_TYPE=hpfs +diff --git a/tests/expected/blkid/low-probe-iso b/tests/expected/blkid/low-probe-iso +index af9908aaa..082f0742a 100644 +--- a/tests/expected/blkid/low-probe-iso ++++ b/tests/expected/blkid/low-probe-iso +@@ -1,4 +1,5 @@ + ID_FS_APPLICATION_ID=GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=IsoVolumeName + ID_FS_LABEL_ENC=IsoVolumeName + ID_FS_SYSTEM_ID=LINUX +diff --git a/tests/expected/blkid/low-probe-iso-joliet b/tests/expected/blkid/low-probe-iso-joliet +index 0229a0d2c..06f529d03 100644 +--- a/tests/expected/blkid/low-probe-iso-joliet ++++ b/tests/expected/blkid/low-probe-iso-joliet +@@ -1,4 +1,5 @@ + ID_FS_APPLICATION_ID=GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=ThisWonderfulLabelIsVeryVeryLong + ID_FS_LABEL_ENC=ThisWonderfulLabelIsVeryVeryLong + ID_FS_SYSTEM_ID=LINUX +diff --git a/tests/expected/blkid/low-probe-iso-rr-joliet b/tests/expected/blkid/low-probe-iso-rr-joliet +index 14d550e90..bb3274db3 100644 +--- a/tests/expected/blkid/low-probe-iso-rr-joliet ++++ b/tests/expected/blkid/low-probe-iso-rr-joliet +@@ -1,4 +1,5 @@ + ID_FS_APPLICATION_ID=GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=ThisIsVolumeName + ID_FS_LABEL_ENC=ThisIsVolumeName + ID_FS_SYSTEM_ID=LINUX +diff --git a/tests/expected/blkid/low-probe-jbd b/tests/expected/blkid/low-probe-jbd +index 8dbcdbce0..c9f9f6b79 100644 +--- a/tests/expected/blkid/low-probe-jbd ++++ b/tests/expected/blkid/low-probe-jbd +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LOGUUID=0d7a07df-7b06-4829-bce7-3b9c3ece570c + ID_FS_TYPE=jbd + ID_FS_USAGE=other +diff --git a/tests/expected/blkid/low-probe-jfs b/tests/expected/blkid/low-probe-jfs +index 877fd168e..ac7d31bac 100644 +--- a/tests/expected/blkid/low-probe-jfs ++++ b/tests/expected/blkid/low-probe-jfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=test-jfs + ID_FS_LABEL_ENC=test-jfs + ID_FS_TYPE=jfs +diff --git a/tests/expected/blkid/low-probe-minix-BE b/tests/expected/blkid/low-probe-minix-BE +index 9627799a3..f73f1b5db 100644 +--- a/tests/expected/blkid/low-probe-minix-BE ++++ b/tests/expected/blkid/low-probe-minix-BE +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_TYPE=minix + ID_FS_USAGE=filesystem + ID_FS_VERSION=1 +diff --git a/tests/expected/blkid/low-probe-minix-LE b/tests/expected/blkid/low-probe-minix-LE +index 9627799a3..f73f1b5db 100644 +--- a/tests/expected/blkid/low-probe-minix-LE ++++ b/tests/expected/blkid/low-probe-minix-LE +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_TYPE=minix + ID_FS_USAGE=filesystem + ID_FS_VERSION=1 +diff --git a/tests/expected/blkid/low-probe-nilfs2 b/tests/expected/blkid/low-probe-nilfs2 +index c6c9cab17..ff27e0b23 100644 +--- a/tests/expected/blkid/low-probe-nilfs2 ++++ b/tests/expected/blkid/low-probe-nilfs2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=test-nilfs2 + ID_FS_LABEL_ENC=test-nilfs2 + ID_FS_TYPE=nilfs2 +diff --git a/tests/expected/blkid/low-probe-ntfs b/tests/expected/blkid/low-probe-ntfs +index aaaa077da..790157aaa 100644 +--- a/tests/expected/blkid/low-probe-ntfs ++++ b/tests/expected/blkid/low-probe-ntfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=Новый_том + ID_FS_LABEL_ENC=Новый\x20том + ID_FS_TYPE=ntfs +diff --git a/tests/expected/blkid/low-probe-ocfs2 b/tests/expected/blkid/low-probe-ocfs2 +index 2328d21a0..9b84dbe67 100644 +--- a/tests/expected/blkid/low-probe-ocfs2 ++++ b/tests/expected/blkid/low-probe-ocfs2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=test-ocfs2 + ID_FS_LABEL_ENC=test-ocfs2 + ID_FS_TYPE=ocfs2 +diff --git a/tests/expected/blkid/low-probe-reiser3 b/tests/expected/blkid/low-probe-reiser3 +index d376ecae1..1c4b1478d 100644 +--- a/tests/expected/blkid/low-probe-reiser3 ++++ b/tests/expected/blkid/low-probe-reiser3 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=TESTREISER + ID_FS_LABEL_ENC=TESTREISER + ID_FS_TYPE=reiserfs +diff --git a/tests/expected/blkid/low-probe-reiser4 b/tests/expected/blkid/low-probe-reiser4 +index 65d63aa65..66df064fd 100644 +--- a/tests/expected/blkid/low-probe-reiser4 ++++ b/tests/expected/blkid/low-probe-reiser4 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=TESTR4 + ID_FS_LABEL_ENC=TESTR4 + ID_FS_TYPE=reiser4 +diff --git a/tests/expected/blkid/low-probe-romfs b/tests/expected/blkid/low-probe-romfs +index 2eb982bc1..b56a6b881 100644 +--- a/tests/expected/blkid/low-probe-romfs ++++ b/tests/expected/blkid/low-probe-romfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=test-romfs + ID_FS_LABEL_ENC=test-romfs + ID_FS_TYPE=romfs +diff --git a/tests/expected/blkid/low-probe-small-fat32 b/tests/expected/blkid/low-probe-small-fat32 +index 39239e6b3..5dba03ec3 100644 +--- a/tests/expected/blkid/low-probe-small-fat32 ++++ b/tests/expected/blkid/low-probe-small-fat32 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=TESTVFAT + ID_FS_LABEL_ENC=TESTVFAT + ID_FS_TYPE=vfat +diff --git a/tests/expected/blkid/low-probe-udf b/tests/expected/blkid/low-probe-udf +index 902fb82f0..869a335db 100644 +--- a/tests/expected/blkid/low-probe-udf ++++ b/tests/expected/blkid/low-probe-udf +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=test-udf + ID_FS_LABEL_ENC=test-udf + ID_FS_LOGICAL_VOLUME_ID=test-udf +diff --git a/tests/expected/blkid/low-probe-udf-bdr-2.60-nero b/tests/expected/blkid/low-probe-udf-bdr-2.60-nero +index c0b8867b5..fcf29b112 100644 +--- a/tests/expected/blkid/low-probe-udf-bdr-2.60-nero ++++ b/tests/expected/blkid/low-probe-udf-bdr-2.60-nero +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-cd-mkudfiso-20100208 b/tests/expected/blkid/low-probe-udf-cd-mkudfiso-20100208 +index f57dee08b..768d0d2f0 100644 +--- a/tests/expected/blkid/low-probe-udf-cd-mkudfiso-20100208 ++++ b/tests/expected/blkid/low-probe-udf-cd-mkudfiso-20100208 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=Volume_Label + ID_FS_LABEL_ENC=Volume\x20Label + ID_FS_LOGICAL_VOLUME_ID=Volume Label +diff --git a/tests/expected/blkid/low-probe-udf-cd-nero-6 b/tests/expected/blkid/low-probe-udf-cd-nero-6 +index cf85ea9c5..41f9ff509 100644 +--- a/tests/expected/blkid/low-probe-udf-cd-nero-6 ++++ b/tests/expected/blkid/low-probe-udf-cd-nero-6 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=UDF_Label + ID_FS_LABEL_ENC=UDF\x20Label + ID_FS_LOGICAL_VOLUME_ID=UDF Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 +index 5446aec42..e26b2da0c 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-1 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=LinuxUDF + ID_FS_LABEL_ENC=LinuxUDF + ID_FS_LOGICAL_VOLUME_ID=LinuxUDF +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 +index b72fcac72..112768353 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.0.0-2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-1 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-1 +index 20f148549..db9127d34 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-1 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-1 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-2 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-2 +index 34a2f49e3..f472284f3 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-2 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-2 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-3 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-3 +index 3fef2b3c6..6f4802ca0 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-3 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-3 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_LABEL=ÿ + ID_FS_LABEL_ENC=ÿ + ID_FS_LOGICAL_VOLUME_ID=ÿ +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 +index 28cd73603..0ae5b910e 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-4 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=1024 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 +index d84ae8964..1b98c21ed 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-5 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=Label + ID_FS_LABEL_ENC=Label + ID_FS_LOGICAL_VOLUME_ID=Label +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 +index d73914970..c22c96b0a 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-6 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ID_FS_LABEL_ENC=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ID_FS_LOGICAL_VOLUME_ID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-7 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-7 +index a78606eea..c3b9d8a8a 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-7 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-7 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=4096 + ID_FS_LABEL=Label4096 + ID_FS_LABEL_ENC=Label4096 + ID_FS_LOGICAL_VOLUME_ID=Label4096 +diff --git a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-8 b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-8 +index 448c8f90b..58c131f7d 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-8 ++++ b/tests/expected/blkid/low-probe-udf-hdd-mkudffs-1.3-8 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=LinuxUDF + ID_FS_LABEL_ENC=LinuxUDF + ID_FS_LOGICAL_VOLUME_ID=LinuxUDF +diff --git a/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.5 b/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.5 +index b33c814d6..18930cead 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.5 ++++ b/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.5 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=discname + ID_FS_LABEL_ENC=discname + ID_FS_LOGICAL_VOLUME_ID=discname +diff --git a/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.7 b/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.7 +index a47bd3f12..13e984167 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.7 ++++ b/tests/expected/blkid/low-probe-udf-hdd-udfclient-0.7.7 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=discname + ID_FS_LABEL_ENC=discname + ID_FS_LOGICAL_VOLUME_ID=discname +diff --git a/tests/expected/blkid/low-probe-udf-hdd-win7 b/tests/expected/blkid/low-probe-udf-hdd-win7 +index 759c8db3d..e68f180e5 100644 +--- a/tests/expected/blkid/low-probe-udf-hdd-win7 ++++ b/tests/expected/blkid/low-probe-udf-hdd-win7 +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=My_volume_label + ID_FS_LABEL_ENC=My\x20volume\x20label + ID_FS_LOGICAL_VOLUME_ID=My volume label +diff --git a/tests/expected/blkid/low-probe-ufs b/tests/expected/blkid/low-probe-ufs +index 96828d73e..256f065d2 100644 +--- a/tests/expected/blkid/low-probe-ufs ++++ b/tests/expected/blkid/low-probe-ufs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=2048 + ID_FS_TYPE=ufs + ID_FS_USAGE=filesystem + ID_FS_UUID=4b0e640aec56ac70 +diff --git a/tests/expected/blkid/low-probe-xfs b/tests/expected/blkid/low-probe-xfs +index f21d881a5..6eb1b4600 100644 +--- a/tests/expected/blkid/low-probe-xfs ++++ b/tests/expected/blkid/low-probe-xfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=test-xfs + ID_FS_LABEL_ENC=test-xfs + ID_FS_TYPE=xfs +diff --git a/tests/expected/blkid/low-probe-zfs b/tests/expected/blkid/low-probe-zfs +index 952e0e591..0e7af2866 100644 +--- a/tests/expected/blkid/low-probe-zfs ++++ b/tests/expected/blkid/low-probe-zfs +@@ -1,3 +1,4 @@ ++ID_FS_BLOCK_SIZE=512 + ID_FS_LABEL=tank + ID_FS_LABEL_ENC=tank + ID_FS_TYPE=zfs_member +-- +2.25.4 + diff --git a/SOURCES/0038-libblkid-xfs-fix-sector-size-calculation.patch b/SOURCES/0038-libblkid-xfs-fix-sector-size-calculation.patch new file mode 100644 index 0000000..dd0d58d --- /dev/null +++ b/SOURCES/0038-libblkid-xfs-fix-sector-size-calculation.patch @@ -0,0 +1,29 @@ +From 28b89361bf574af24c2f9c857d0e5f7c84e2787c Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 3 Sep 2019 15:10:35 +0200 +Subject: [PATCH 38/40] libblkid: (xfs) fix sector size calculation + +Reported-by: Anatoly Pugachev +Upstream: http://github.com/karelzak/util-linux/commit/2771d40b88660a11306aa5d4e200fc0ebebfe315 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1817726 +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/xfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libblkid/src/superblocks/xfs.c b/libblkid/src/superblocks/xfs.c +index eb513ac3e..98e59ff7c 100644 +--- a/libblkid/src/superblocks/xfs.c ++++ b/libblkid/src/superblocks/xfs.c +@@ -173,7 +173,7 @@ static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag) + blkid_probe_set_label(pr, (unsigned char *) xs->sb_fname, + sizeof(xs->sb_fname)); + blkid_probe_set_uuid(pr, xs->sb_uuid); +- blkid_probe_set_block_size(pr, xs->sb_sectsize * 256); ++ blkid_probe_set_block_size(pr, be16_to_cpu(xs->sb_sectsize)); + return 0; + } + +-- +2.25.4 + diff --git a/SOURCES/0039-col-make-flush_line-a-little-bit-robust.patch b/SOURCES/0039-col-make-flush_line-a-little-bit-robust.patch new file mode 100644 index 0000000..f586752 --- /dev/null +++ b/SOURCES/0039-col-make-flush_line-a-little-bit-robust.patch @@ -0,0 +1,68 @@ +From 54e3d1414e1a031d6f635f8fcbe273eecfd65560 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 5 Feb 2019 12:06:00 +0100 +Subject: [PATCH 39/40] col: make flush_line() a little bit robust + +The code is horrible. The core of the problem are signed integers +and no check for the limits. + +This patch fixes c->c_column = cur_col; where c_column is "short" +and "cur_col" is int. Let's use "int" for all the variables. It's +really not perfect as for bigger lines it can segfault again... + +The patch also removes some unnecessary static variables. + +Upstream: http://github.com/karelzak/util-linux/commit/004356f05018e3bfcaddd2652846659a4d8481f3 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1803753 +Addresses: https://github.com/karelzak/util-linux/issues/749 +Signed-off-by: Karel Zak +--- + text-utils/col.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/text-utils/col.c b/text-utils/col.c +index 3d9e15d26..c2f8db64d 100644 +--- a/text-utils/col.c ++++ b/text-utils/col.c +@@ -88,7 +88,7 @@ typedef char CSET; + typedef struct char_str { + #define CS_NORMAL 1 + #define CS_ALTERNATE 2 +- short c_column; /* column character is in */ ++ int c_column; /* column character is in */ + CSET c_set; /* character set (currently only 2) */ + wchar_t c_char; /* character in question */ + int c_width; /* character width */ +@@ -476,8 +476,9 @@ void flush_line(LINE *l) + nchars = l->l_line_len; + + if (l->l_needs_sort) { +- static CHAR *sorted; +- static int count_size, *count, i, save, sorted_size, tot; ++ static CHAR *sorted = NULL; ++ static int count_size = 0, *count = NULL, sorted_size = 0; ++ int i, tot; + + /* + * Do an O(n) sort on l->l_line by column being careful to +@@ -494,7 +495,7 @@ void flush_line(LINE *l) + (unsigned)sizeof(int) * count_size); + } + memset(count, 0, sizeof(int) * l->l_max_col + 1); +- for (i = nchars, c = l->l_line; --i >= 0; c++) ++ for (i = nchars, c = l->l_line; c && --i >= 0; c++) + count[c->c_column]++; + + /* +@@ -502,7 +503,7 @@ void flush_line(LINE *l) + * indices into new line. + */ + for (tot = 0, i = 0; i <= l->l_max_col; i++) { +- save = count[i]; ++ int save = count[i]; + count[i] = tot; + tot += save; + } +-- +2.25.4 + diff --git a/SOURCES/0040-libmount-improve-smb-2-3-support.patch b/SOURCES/0040-libmount-improve-smb-2-3-support.patch new file mode 100644 index 0000000..d30a197 --- /dev/null +++ b/SOURCES/0040-libmount-improve-smb-2-3-support.patch @@ -0,0 +1,49 @@ +From 2cd5219da87274db251a7f836efe6ac724b70e53 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 11 Mar 2020 10:38:37 +0100 +Subject: [PATCH 40/40] libmount: improve smb{2,3} support + +It seems kernel can use smb3 as fstype in mountinfo. + +Upstream: http://github.com/karelzak/util-linux/commit/36d80cb6c11b3064ed9fb29c7c8b101e3f266441 +Upstream: http://github.com/karelzak/util-linux/commit/b7ff4134beea53688ab3c01484cf59b2ce2d9ce9 +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1812118 +Signed-off-by: Karel Zak +--- + libmount/src/tab.c | 5 ++++- + libmount/src/utils.c | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libmount/src/tab.c b/libmount/src/tab.c +index eb61dd33e..74d60df3d 100644 +--- a/libmount/src/tab.c ++++ b/libmount/src/tab.c +@@ -1644,9 +1644,12 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + if (root) { + const char *fstype = mnt_fs_get_fstype(fs); + +- if (fstype && strcmp(fstype, "cifs") == 0) { ++ if (fstype && (strcmp(fstype, "cifs") == 0 ++ || strcmp(fstype, "smb3") == 0)) { ++ + const char *unc_subdir = get_cifs_unc_subdir_path(src); + const char *path_on_fs = mnt_fs_get_root(fs); ++ + if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs)) + continue; + } else { +diff --git a/libmount/src/utils.c b/libmount/src/utils.c +index 04e79f53f..e43588831 100644 +--- a/libmount/src/utils.c ++++ b/libmount/src/utils.c +@@ -315,6 +315,7 @@ int mnt_fstype_is_pseudofs(const char *type) + int mnt_fstype_is_netfs(const char *type) + { + if (strcmp(type, "cifs") == 0 || ++ strcmp(type, "smb3") == 0 || + strcmp(type, "smbfs") == 0 || + strncmp(type,"nfs", 3) == 0 || + strcmp(type, "afs") == 0 || +-- +2.25.4 + diff --git a/SOURCES/0041-libmount-fix-mount-a-EBUSY-for-cifs.patch b/SOURCES/0041-libmount-fix-mount-a-EBUSY-for-cifs.patch new file mode 100644 index 0000000..28e915e --- /dev/null +++ b/SOURCES/0041-libmount-fix-mount-a-EBUSY-for-cifs.patch @@ -0,0 +1,65 @@ +From 618aedc9e892b206492c1720bec261b043c66263 Mon Sep 17 00:00:00 2001 +From: Roberto Bergantinos Corpas +Date: Mon, 27 Apr 2020 15:46:02 +0200 +Subject: [PATCH] libmount: fix mount -a EBUSY for cifs + +fstab: + + //rhel73/myshare/sub/path /mnt cifs + +after mount in mountinfo: + + # grep cifs /proc/self/mountinfo + 47 39 0:40 /sub/path /mnt rw,relatime shared:60 - cifs //rhel73/myshare/sub/path ... + ^^^^^^^^^ +or: + + # grep cifs /proc/self/mountinfo + 47 39 0:40 / /mnt rw,relatime shared:60 - cifs //rhel73/myshare/sub/path ... + ^ + +That is so since on kernel cifs code, cifs_get_root (which returns the +entry associated with mnt_root) return s_root if +CIFS_MOUNT_USE_PREFIX_PATH is set, no questions asked. + +This situation can occurr often on CIFS mounts, as CIFS servers limit +frequently scope of access to the root path. + +[kzak@redhat.com: - add more info to the commit message, + - clean up variable names] + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1829245 +Upstream: http://github.com/karelzak/util-linux/commit/31b3a523eca2fc7e5876ec5fd89094208fed0899 +Signed-off-by: Roberto Bergantinos Corpas +Signed-off-by: Karel Zak +--- + libmount/src/tab.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/libmount/src/tab.c b/libmount/src/tab.c +index 74d60df3d..cd97a1cb5 100644 +--- a/libmount/src/tab.c ++++ b/libmount/src/tab.c +@@ -1644,13 +1644,14 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) + if (root) { + const char *fstype = mnt_fs_get_fstype(fs); + +- if (fstype && (strcmp(fstype, "cifs") == 0 +- || strcmp(fstype, "smb3") == 0)) { ++ if (fstype && (strcmp(fstype, "cifs") == 0 || ++ strcmp(fstype, "smb3") == 0)) { + +- const char *unc_subdir = get_cifs_unc_subdir_path(src); +- const char *path_on_fs = mnt_fs_get_root(fs); ++ const char *sub = get_cifs_unc_subdir_path(src); ++ const char *r = mnt_fs_get_root(fs); + +- if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs)) ++ if (!sub || !r || (!streq_paths(sub, r) && ++ !streq_paths("/", r))) + continue; + } else { + const char *r = mnt_fs_get_root(fs); +-- +2.25.4 + diff --git a/SOURCES/0042-Manual-pages-losetup.8-Fix-direct-io-defaults.patch b/SOURCES/0042-Manual-pages-losetup.8-Fix-direct-io-defaults.patch new file mode 100644 index 0000000..19dbf34 --- /dev/null +++ b/SOURCES/0042-Manual-pages-losetup.8-Fix-direct-io-defaults.patch @@ -0,0 +1,31 @@ +From 0717177be22588d4e419de280eccd0eeafb15016 Mon Sep 17 00:00:00 2001 +From: Rupesh Girase +Date: Thu, 18 Jun 2020 19:17:41 +0530 +Subject: [PATCH] Manual pages: losetup.8: Fix "--direct-io" defaults + +"--direct-io" option is "off" by default while configuring +loop device but it's mentioned "on" in man page. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1848919 +Upstream: http://github.com/karelzak/util-linux/commit/4bee67e2d1a78abc52e89c6eb71f0efc8a278ce9 +Signed-off-by: Rupesh Girase +--- + sys-utils/losetup.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 +index cdb9ed052..c87c231b6 100644 +--- a/sys-utils/losetup.8 ++++ b/sys-utils/losetup.8 +@@ -130,7 +130,7 @@ Set up a read-only loop device. + .BR \-\-direct\-io [ =on | off ] + Enable or disable direct I/O for the backing file. The optional argument + can be either \fBon\fR or \fBoff\fR. If the argument is omitted, it defaults +-to \fBon\fR. ++to \fBoff\fR. + .TP + .BR \-v , " \-\-verbose" + Verbose mode. +-- +2.25.4 + diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec index cf2d224..fddfee9 100644 --- a/SPECS/util-linux.spec +++ b/SPECS/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.32.1 -Release: 17%{?dist} +Release: 24%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://en.wikipedia.org/wiki/Util-linux @@ -44,6 +44,7 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: bison +BuildRequires: git-core ### Sources Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v%{upstream_major}/util-linux-%{upstream_version}.tar.xz @@ -148,6 +149,37 @@ Patch26: 0026-partx-document-d-vs.-nr-and-fix-test.patch Patch27: 0027-libmount-improve-mountinfo-reliability.patch Patch28: 0028-libmount-use-fmemopen-in-more-robust-way-coverity-sc.patch +### RHEL-8.2 +### +# 1739443 - lscpu reports wrong hypervisor in nested virt on s390x +Patch29: 0029-lscpu-use-the-first-VM-from-proc-sysinfo.patch +Patch30: 0030-tests-lscpu-s390-nested-virtualization.patch +# 1743555 - command chfn adds some useless commas with GECOS information into /etc/password +Patch31: 0031-chfn-don-t-append-extra-tailing-commas.patch +Patch32: 0032-tests-add-new-test-for-chfn-gecos.patch +# 1739443 - lscpu reports wrong hypervisor in nested virt on s390x +Patch33: 0033-tests-update-lscpu-test-for-RHEL8.patch +# CI fix +Patch34: 0034-tests-fdisk-make-sure-we-use-the-same-sizes-for-MD-d.patch + +### RHEL-8.3 +### +# 1826251 - remove MD metadata 0.90 based tests from util-linux CI +Patch35: 0035-tests-mark-MD-tests-with-metadata-v0.90-as-KNOWN-FAI.patch +# 1812576 - RFE: Bitlocker detection for RHEL 8.3 +Patch36: 0036-libblkid-add-BitLocker-detection.patch +# 1817726 - libblkid BLOCK_SIZE +Patch37: 0037-blkid-retport-block-size-of-a-filesystem.patch +Patch38: 0038-libblkid-xfs-fix-sector-size-calculation.patch +# 1803753 - col struct char_str c_column field should be of unsigned type and/or larger than 16 bit +Patch39: 0039-col-make-flush_line-a-little-bit-robust.patch +# 1812118 - mount -a always tries to mount smb3 share subdir despite being already mounted. +Patch40: 0040-libmount-improve-smb-2-3-support.patch +# 1829245 - mount -a tries to mount already mounted cifs shares when we cannot query up to root dir +Patch41: 0041-libmount-fix-mount-a-EBUSY-for-cifs.patch +# 1848919 - Update losetup man page to fix "--direct-io" defaults +Patch42: 0042-Manual-pages-losetup.8-Fix-direct-io-defaults.patch + %description The util-linux package contains a large variety of low-level system @@ -329,7 +361,7 @@ chfn and chsh utilities with dependence on libuser %prep -%autosetup -p1 -n %{name}-%{upstream_version} +%autosetup -p1 -Sgit -n %{name}-%{upstream_version} %build unset LINGUAS || : @@ -1013,6 +1045,34 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Fri Jun 26 2020 Karel Zak 2.32.1-24 +- fix #1848919 - Update losetup man page to fix "--direct-io" defaults + +* Thu Jun 11 2020 Karel Zak 2.32.1-23 +- fix #1826251 - remove MD metadata 0.90 based tests from util-linux CI +- fix #1812576 - RFE: Bitlocker detection for RHEL 8.3 +- fix #1817726 - add libblkid BLOCK_SIZE +- fix #1803753 - RHEL-8: col struct char_str c_column field should be of unsigned type and/or larger than 16 bit +- fix #1812118 - mount -a always tries to mount smb3 share subdir despite being already mounted +- fix #1824727 - util-linux: Include python3-libmount package in the release +- fix #1829245 - mount -a tries to mount already mounted cifs shares when we cannot query up to root dir + +* Tue Dec 17 2019 Karel Zak 2.32.1-22 +- improve CI tests portability to rhel-8 kernel + +* Tue Dec 17 2019 Karel Zak 2.32.1-21 +- add git to BuildRequires due to autosetup -Sgit + +* Tue Dec 17 2019 Karel Zak 2.32.1-20 +- fix spec file typo + +* Tue Dec 17 2019 Karel Zak 2.32.1-19 +- fix test for #1739443 + +* Mon Dec 16 2019 Karel Zak 2.32.1-18 +- fix #1739443 - lscpu reports wrong hypervisor in nested virt on s390x +- fix #1743555 - command chfn adds some useless commas with GECOS information into /etc/password + * Sat Sep 21 2019 Karel Zak 2.32.1-17 - fix error path in mountinfo patch (#1751447)