+++ This bug was initially created as a clone of Bug #1770304 +++ Description of problem: I initially was going to file this against the kernel, but I'm leaning more now towards supermin doing something funky. After upgrading the kernel from 5.3.7 to 5.3.8, we've noticed a regression where our supermin appliance only sees one file in `/etc/pki/rpm-gpg`, instead of all the GPG keys. Version-Release number of selected component (if applicable): Reproduces with supermin-5.1.20-8.fc31.x86_64 + kernel-5.3.[89]. Does not reproduce with supermin-5.1.20-8.fc31.x86_64 + kernel-5.3.7. How reproducible: 100% Steps to Reproduce: $ supermin --prepare bash util-linux -o /tmp/supermin.d $ supermin --build /tmp/supermin.d -f ext2 -o /tmp/appliance.d $ ll /tmp/appliance.d/root -rw-r--r--. 1 rjones rjones 4294967296 Nov 26 08:38 /tmp/appliance.d/root $ guestfish --ro -a /tmp/appliance.d/root -m /dev/sda ll / libguestfs: error: ll: ls: reading directory '/sysroot/': Input/output error Copying the /tmp/appliance.d/root file to a < 5.3.8 kernel machine shows: lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64 lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin which are clearly invalid directory entries.
Patch posted: https://www.redhat.com/archives/libguestfs/2019-November/msg00262.html
Note for RHEL 8 - this doesn't break the kernel ... yet. But it's only a matter of time before this patch gets backported and then libguestfs will break: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/readdir.c?id=8a23eb804ca4f2be909e372cf5a9e7b30ae476cd In any case even on RHEL 8 we're still generating obviously incorrect symlinks.
Upstream in https://github.com/libguestfs/supermin/commit/487e8c964078f823646d3b0584745ab7d0ef99ca
(In reply to Richard W.M. Jones from comment #3) > Upstream in > https://github.com/libguestfs/supermin/commit/ > 487e8c964078f823646d3b0584745ab7d0ef99ca This patch is also required: https://github.com/libguestfs/supermin/commit/62d5c774d6c8fcac11e28fcba99754b5478e5088
1.On fedora31 host Verified with packages: supermin-5.2.0-1.fc32.x86_64 kernel-5.3.8-300.fc31.x86_64 Steps: $ supermin --prepare bash util-linux -o supermin.d $ supermin --build supermin.d -f ext2 -o appliance.d $ ll appliance.d/root -rw-r--r--. 1 yoguo yoguo 4294967296 Jun 11 05:05 appliance.d/root $ guestfish --ro -a appliance.d/root -m /dev/sda ll / total 84 drwxr-xr-x 18 root root 4096 Jun 11 09:05 . drwxr-xr-x 19 root root 4096 Jun 11 09:06 .. lrwxrwxrwx 1 root root 7 Jun 11 09:05 bin -> usr/bin dr-xr-xr-x 2 root root 4096 Jun 11 05:22 boot drwxr-xr-x 2 root root 4096 Jun 11 02:54 dev drwxrwxr-x 30 1000 1000 4096 Jun 11 09:05 etc drwxr-xr-x 2 root root 4096 Jun 11 09:01 home lrwxrwxrwx 1 root root 7 Jun 11 09:05 lib -> usr/lib lrwxrwxrwx 1 root root 9 Jun 11 09:05 lib64 -> usr/lib64 drwx------ 2 root root 16384 Jun 11 09:05 lost+found drwxr-xr-x 2 root root 4096 Jul 25 2019 media drwxr-xr-x 2 root root 4096 Jul 25 2019 mnt drwxr-xr-x 2 root root 4096 Jul 25 2019 opt dr-xr-xr-x 2 root root 4096 Jun 11 02:53 proc dr-xr-x--- 2 root root 4096 Mar 3 07:35 root drwxrwxr-x 8 1000 1000 4096 Jun 11 09:05 run lrwxrwxrwx 1 root root 8 Jun 11 09:05 sbin -> usr/sbin drwxr-xr-x 2 root root 4096 Jul 25 2019 srv dr-xr-xr-x 2 root root 4096 Jun 11 02:53 sys drwxrwxrwt 2 root root 4096 Jun 11 09:04 tmp drwxrwxr-x 12 1000 1000 4096 Jun 11 09:05 usr drwxr-xr-x 18 root root 4096 Jan 2 06:03 var It works well. 2.On rhel8.3 host Verified with packages: supermin-5.2.0-1.module+el8.3.0+6988+f94ae0b7.x86_64 kernel-4.18.0-196.el8.x86_64 Steps: $ supermin --prepare bash util-linux -o supermin.d $ supermin --build supermin.d -f ext2 -o appliance.d $ ll appliance.d/root -rw-r--r--. 1 yoguo yoguo 4294967296 Jun 11 04:54 appliance.d/root $ guestfish --ro -a appliance.d/root -m /dev/sda ll / total 84 drwxr-xr-x 18 root root 4096 Jun 11 08:54 . drwxr-xr-x 19 root root 4096 Jun 11 08:56 .. lrwxrwxrwx 1 root root 7 Jun 11 08:54 bin -> usr/bin dr-xr-xr-x 2 root root 4096 Jun 4 12:34 boot drwxr-xr-x 2 root root 4096 May 26 07:14 dev drwxr-xr-x 32 root root 4096 Jun 11 08:54 etc drwxr-xr-x 2 root root 4096 May 28 12:44 home lrwxrwxrwx 1 root root 7 Jun 11 08:54 lib -> usr/lib lrwxrwxrwx 1 root root 9 Jun 11 08:54 lib64 -> usr/lib64 drwx------ 2 root root 16384 Jun 11 08:54 lost+found drwxr-xr-x 2 root root 4096 Apr 23 11:59 media drwxr-xr-x 2 root root 4096 Apr 23 11:59 mnt drwxr-xr-x 2 root root 4096 May 15 11:47 opt dr-xr-xr-x 2 root root 4096 May 11 10:11 proc dr-xr-x--- 2 root root 4096 Jun 9 01:58 root drwxr-xr-x 7 root root 4096 Jun 8 12:24 run lrwxrwxrwx 1 root root 8 Jun 11 08:54 sbin -> usr/sbin drwxr-xr-x 2 root root 4096 Apr 23 11:59 srv dr-xr-xr-x 2 root root 4096 May 11 14:12 sys drwxrwxrwt 2 root root 4096 Jun 11 08:54 tmp drwxr-xr-x 12 root root 4096 Jun 11 08:54 usr drwxr-xr-x 19 root root 4096 May 11 14:12 var In fact, this issue can not be reproduced due to the current kernel on rhel8 (comment 2).
(In reply to YongkuiGuo from comment #7) > In fact, this issue can not be reproduced due to the current kernel on rhel8 > (comment 2). Correct - we don't expect old supermin to break until someone applies the kernel patch. So the verification is just to check that supermin still works, which you've done, thanks.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5137