Bug 1372037

Summary: txz-in hangs on btrfs filesystem
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
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:
Attachments:
Description Flags
log up to the point where it hangs none

Description Richard W.M. Jones 2016-08-31 18:30:22 UTC
Description of problem:

A one line reproducer is from the libguestfs source directory is:

./run guestfish -N fs:btrfs:1G -m /dev/sda1 txz-in test-data/files/filesanddirs-10M.tar.xz / -v -x

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

libguestfs 1.35.2
kernel-4.8.0-0.rc4.git0.1.fc26.x86_64
qemu-2.7.0-0.2.rc3.fc26.x86_64
btrfs-progs-4.7.1-1.fc26.x86_64

How reproducible:

100%

Steps to Reproduce:
1. As above.

Additional info:

It only happens on one of my machines.

It happens with either KVM or TCG.

The same pattern is found in tests/btrfs/test-btrfs-devices,sh, where
it causes the test suite to hang

Comment 1 Richard W.M. Jones 2016-08-31 18:31:30 UTC
Created attachment 1196488 [details]
log up to the point where it hangs

Comment 2 Richard W.M. Jones 2016-08-31 19:11:50 UTC
I'm fairly sure this is a kernel/qemu/something bug.

In fact the command proceeds, but very very slowly, taking about
10 minutes to unpack that 8K tar.xz file.

Here is an even simpler demonstration of the problem:

./run guestfish -N fs:btrfs:1G -m /dev/sda1 -v -x \
    upload test-data/files/filesanddirs-10M.tar.xz /test.tar.xz : \
    debug sh "cd /sysroot && tar --xz -xvf test.tar.xz"

Comment 3 Richard W.M. Jones 2016-08-31 19:24:35 UTC
Making the virtual disk larger (eg. 10G) improves the performance,
so I suspect that btrfs is having problems coping with lack of free
space.