Bug 1528541 - qemu-img check reports tons of leaked clusters after re-start nfs service to resume writing data in guest
Summary: qemu-img check reports tons of leaked clusters after re-start nfs service to ...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Tingting Mao
: 1302929 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2017-12-22 05:23 UTC by Ping Li
Modified: 2018-11-01 11:05 UTC (History)
13 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-11-01 11:04:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3443 None None None 2018-11-01 11:05:51 UTC

Comment 2 Ping Li 2017-12-22 05:34:06 UTC
The default timeo for mount is 600(60s). If the nfs outage time is less than 60s, qemu will not be paused as "io-error". Then the issue does not exist.

Comment 5 Kevin Wolf 2018-06-28 16:03:56 UTC
This won't be a full solution, but I think the following patch series that I just posted upstream will go a long way towards making this a rarer event.

[PATCH 0/3] qcow2: Fix cluster leaks on write error

Comment 7 Miroslav Rezanina 2018-07-04 08:19:23 UTC
Fix included in qemu-kvm-rhev-2.12.0-7.el7

Comment 9 Jeff Nelson 2018-07-10 21:55:35 UTC
*** Bug 1302929 has been marked as a duplicate of this bug. ***

Comment 10 Tingting Mao 2018-07-11 06:14:56 UTC
Verify this issue like below.

Tested packages:

1. Use soft mode to mount a nfs server to local directory
# mount -t nfs -o soft /home/share/

2. Copy the installed base file to /home/share/, then boot a vm from base file
/usr/libexec/qemu-kvm \
        -name 'guest-rhel7.5' \
        -machine pc \
        -nodefaults \
        -vga qxl \
        -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x8 \
        -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=unsafe,format=qcow2,file=/home/share/base.qcow2 \
        -device scsi-hd,id=image1,drive=drive_image1,bootindex=0 \
        -vnc :0 \
        -monitor stdio \
        -m 8192 \
        -smp 8 \
        -device virtio-net-pci,mac=9a:b5:b6:b1:b5:b3,id=idMmq1jH,vectors=4,netdev=idxgXAlm,bus=pci.0,addr=0x9  \
        -netdev tap,id=idxgXAlm \

3. Do write opration through dd command in the guest
#dd if=/dev/urandom of=/home/ftest bs=1M count=4096

4. Make nfs outage for a short period
#service nfs stop
#service nfs start

5. Shutdown the guest after dd process finished(if added "rerror=stop,werror=stop", resume the vm first)

6. Check the image
# qemu-img check /home/share/base.qcow2
No errors were found on the image.
93509/327680 = 28.54% allocated, 14.95% fragmented, 0.00% compressed clusters
Image end offset: 6129844224

The result is also correct when adding "rerror=stop,werror=stop" options for qemu-kvm command line to boot base file.

So set the bug as verified.

Comment 11 errata-xmlrpc 2018-11-01 11:04:00 UTC
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.