Bug 2041461
Summary: | Inconsistent block status reply in qemu-nbd | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Nir Soffer <nsoffer> | ||||
Component: | qemu-kvm | Assignee: | Hanna Czenczek <hreitz> | ||||
qemu-kvm sub component: | Storage | QA Contact: | Tingting Mao <timao> | ||||
Status: | CLOSED ERRATA | Docs Contact: | |||||
Severity: | high | ||||||
Priority: | high | CC: | bstinson, coli, hreitz, jinzhao, juzhang, jwboyer, kkiwi, timao, virt-maint, ymankad | ||||
Version: | CentOS Stream | Keywords: | Regression, Triaged | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | qemu-kvm-6.2.0-8.el9 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2022-05-17 12:25:11 UTC | 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: | 2041480 | ||||||
Attachments: |
|
Description
Nir Soffer
2022-01-17 11:57:45 UTC
Tried to reproduce this issue, but failed. Could anyone help to check where is wrong? Thanks. Tested with: qemu-kvm-6.2.0-4.el9 kernel-5.14.0-39.el9.x86_64 Steps: 1. Prepare an image and expose it via nbd # truncate -s1g empty.raw # qemu-nbd --read-only --persistent --allocation-depth --socket=/tmp/nbd.sock --format=raw empty.raw & 2. Access the image to get info via qemu-img map # qemu-img map --output=json --image-opts driver=nbd,server.path=/tmp/nbd.sock,server.type=unix,x-dirty-bitmap=qemu:allocation-depth [{ "start": 0, "length": 1073741824, "depth": 0, "present": false, "zero": false, "data": false}] # qemu-img map --output=json --image-opts driver=nbd,server.path=/tmp/nbd.sock,server.type=unix,x-dirty-bitmap=qemu:allocation-depth [{ "start": 0, "length": 1073741824, "depth": 0, "present": false, "zero": false, "data": false}] 3. Access the image via nbdinfo # nbdinfo --map=qemu:allocation-depth --json nbd+unix:///?socket=/tmp/nbd.sock [ { "offset": 0, "length": 1073741824, "type": 1, "description": "local"} ] # nbdinfo --map=qemu:allocation-depth --json nbd+unix:///?socket=/tmp/nbd.sock [ { "offset": 0, "length": 1073741824, "type": 1, "description": "local"} ] Results: As above, the dumped info is always the same. And from step3, the type is always '1', but not '0' or '3' as Comment0. (In reply to Tingting Mao from comment #2) > Tried to reproduce this issue, but failed. Could anyone help to check where > is wrong? Thanks. Nir, Can you help? Hanna, I think this one was submitted/merged upstream? Can you update us on the bug status? Thanks. Reproducing this is tricky, here is example flow: $ qemu-img create -f raw empty.raw 1g $ qemu-nbd --read-only --persistent --allocation-depth --socket=/tmp/nbd.sock --format=raw empty.raw & $ nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero Correct results ^^^^ Now run twice nbd info... $ nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local $ nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local Also correct - but now the internal cache is corrupted: $ nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data Incorrect results ^^^ All future nbdinfo --map commands will return incorrect info: $ nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data $ nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data The patch adding the tests how to reproduce it with qemu-img map, and add more info why it needs 2 calls with qemu:alloction-depth to trigger the issue. https://lists.nongnu.org/archive/html/qemu-block/2022-01/msg00371.html The patch(es) were merged upstream a week ago (Jan 30), I’m working on a backport. Reproduced this bug in latest rhel9, thanks Nir. Tested with: qemu-kvm-6.2.0-6.el9 kernel-5.14.0-39.el9.x86_64 Steps: 1. Create test image and export is over nbd # qemu-img create -f raw empty.raw 1g # qemu-nbd --read-only --persistent --allocation-depth --socket=/tmp/nbd.sock --format=raw empty.raw & 2. Map the image via base:allocation # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero 3. Map the image via qemu:allocaton-depth twice # nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local # nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local 4. Map the image via base:allocation # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data 5. Map more times # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data # nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 0 data Results: As above, the results for step4 and step5 are incorrect. The correct result should be like the step2. QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass. Verified this bug as below: Tested with: qemu-kvm-6.2.0-8.el9 kernel-5.14.0-54.kpq0.el9.x86_64 Steps: 1. Create test image and export is over nbd # qemu-img create -f raw empty.raw 1g # qemu-nbd --read-only --persistent --allocation-depth --socket=/tmp/nbd.sock --format=raw empty.raw & 2. Map the image via base:allocation # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero 3. Map the image via qemu:allocaton-depth twice # nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local # nbdinfo --map=qemu:allocation-depth nbd+unix:///?socket=/tmp/nbd.sock 0 1073741824 1 local 4. Map the image via base:allocation # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero 5. Map more times # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero # nbdinfo --map=base:allocation nbd+unix:///?socket=/tmp/nbd.sock 0 4096 0 data 4096 1073737728 3 hole,zero Results: As above, the dumped info of step5 do not changed, that means it stay the same as the results of step2. 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 (new packages: qemu-kvm), 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-2022:2307 |