Bug 2223895

Summary: ReaR fails to create the rescue environment when a device is shrinking while being read
Product: Red Hat Enterprise Linux 9 Reporter: Renaud Métrich <rmetrich>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: POST --- QA Contact: Jakub Haruda <jharuda>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.2CC: jharuda, pcahyna
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2223896, 2223897    
Attachments:
Description Flags
systemtap script shrinking file "shrinking" when being read none

Description Renaud Métrich 2023-07-19 08:29:52 UTC
Description of problem:

A customer hit an issue when building the ReaR ISO: the process always fails due to having a `/dev/mqueue/nnsc` which shrinks when being read, causing the verification code to (hopefully) fail.
See PR https://github.com/rear/rear/pull/3027 for details and a reproducer.

Version-Release number of selected component (if applicable):

all rear releases

How reproducible:

Always using the attached reproducer `shrinking.stp`

Steps to Reproduce:

1. Create a file in /dev which will be embedded in the rescue environment

    # dd if=/dev/urandom of=/dev/shrinking bs=10K count=3
    3+0 records in
    3+0 records out
    30720 bytes (31 kB, 30 KiB) copied, 0.000689566 s, 44.5 MB/s

2. Execute the systemtap script in charge of shrinking the file while being copied

    # yum -y install systemtap yum-utils
    # stap-prep
    # stap -v -g ./shrinking.stp
    [...]
    Pass 5: starting run.

3. Execute rear mkrescue from another terminal

    # rear mkrescue

Actual results:

ERROR: ReaR recovery system in '/var/tmp/rear.tpfZyNy6ayS53wP/rootfs' not usable (required libraries are missing)
Some latest log messages since the last called script 990_verify_rootfs.sh:
  wipefs is /bin/wipefs
  mkfs is /bin/mkfs
  mkfs.xfs is /bin/mkfs.xfs
  xfs_admin is /bin/xfs_admin
  mkswap is /bin/mkswap
  cryptsetup is /bin/cryptsetup
  dmsetup is /bin/dmsetup
  ldconfig is /bin/ldconfig

Expected results:

No error

Comment 1 Renaud Métrich 2023-07-19 08:30:51 UTC
Created attachment 1976469 [details]
systemtap script shrinking file "shrinking" when being read