Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1532481

Summary: Some dedupe scenarios result in ENOSPACE way too early.
Product: Red Hat Enterprise Linux 7 Reporter: Sweet Tea Dorminy <sweettea>
Component: kmod-kvdoAssignee: Sweet Tea Dorminy <sweettea>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awalsh, bgurney, jkrysl, limershe, salmy, zlang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.0.115 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 16:26:33 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:

Description Sweet Tea Dorminy 2018-01-09 03:39:23 UTC
Description of problem:

If a write comes into VDO, and has dedupe advice referencing a currently-unallocated block, VDO will increment the wrong in-memory allocated block counter, which is unsigned. If the deduplication attempt fails, VDO will decrement the correct in-memory allocated block counter. This can result in the allocated block counter underflowing. 

A 'slab' of free blocks is prioritized for allocation to incoming writes based on how many free blocks it has. If a slab is of highest priority, but all its free blocks are managed by underflowed allocated block counters, allocation from that entire physical zone will always fail.

If allocation fails from all physical zones, the write is completed with ENOSPACE.

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

How reproducible:
Not particularly.

Steps to Reproduce:
1. Make a VDO with one physical zone and at least two slabs.
2. Perform a workload which repeats writing then trimming 2 distinct datasets, alternately, each of size slightly less than one slab. For most reproducability, the blocks of the dataset should be written in a different order each time.  

Actual results:

EIO when the VDO has less than a slab of data stored.

Expected results:

No EIO when VDO isn't full.

Additional info:

Comment 3 Sweet Tea Dorminy 2018-01-09 15:44:45 UTC
I have verified the following general scenario can provoke this:

Construct a VDO with 1 physical thread and 2G slabs.
Construct and mount a XFS filesystem with discard enabled atop this VDO.
Construct a unique dataset, for instance via dd if=/dev/urandom, of size 1800M.
Repeatedly write, remount FS, remove, remount FS, that dataset to a file on the filesystem atop VDO.


Approximately 20 iterations is typically enough on the system I'm testing on.

Comment 5 Jakub Krysl 2018-01-22 14:28:53 UTC
With 6.1.0.98 I hit it in 8th iteration using reproducer from comment 3.
with 6.1.0.124 I was not able to hit this in 30 iterations.
Setting to verified.

Comment 6 Bryan Gurney 2018-01-29 20:55:36 UTC
*** Bug 1538891 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2018-04-10 16:26:33 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.

https://access.redhat.com/errata/RHEA-2018:0900