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 1505936

Summary: vdo --readCacheSize allows extremely high values without warning
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Krysl <jkrysl>
Component: vdoAssignee: Sweet Tea Dorminy <sweettea>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awalsh, bjohnsto, dkeefe, limershe, sweettea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.0.44 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:46:34 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 Jakub Krysl 2017-10-24 15:12:30 UTC
Description of problem:
When creating VDO with --readCacheSize value set to something extremely (stupidly) high --readCacheSize="8000E", vdo is created without issues. The issue might come sometime in the future where the user might even loose some data when his server runs out of memory.
As adding more restriction to user is not a good thing, can you please make few different changes here?
1) Add a warning to docs,. something along these lines:
 "Warning: setting this value to high can cause the system to run out of memory and hang"
2) Check for actual memory size and in case this value is larger, make the user acknowledge this might be a risk.

Version-Release number of selected component (if applicable):
vdo-6.1.0.0-6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. # vdo create --device=/dev/sdc --name=vdo_test --readCacheSize=8000E --readCache=enabled
2. # vdo status --all | grep "Read cache size"
    Read cache size: 8000E

Actual results:
VDO created with readCacheSize

Expected results:
Explicit warning / prompt for user to acknowledge this value

Additional info:

Comment 2 Dennis Keefe 2017-10-25 19:46:39 UTC
Looking at this issue it seems that setting the readCacheSize to a more 
reasonable value of 1T (knowing that my system doesn't have 1T of memory), VDO
returns with an error messages.

parkst-26:/permabit/user/dkeefe# vdo start --name=my_vdo --verbose
Starting VDO my_vdo
    dmsetup status my_vdo
    modprobe kvdo
    dmsetup create my_vdo --table '0 8589934592 dedupe /dev/sda1 4096 enabled 268435456 32768 16380 on async my_vdo ack=1,bio=4,bioRotationInterval=64,cpu=6,hash=1,logical=5,physical=2'
vdo: ERROR - Could not set up device mapper for my_vdo
vdo: ERROR - device-mapper: reload ioctl on my_vdo  failed: Cannot allocate memory. 

VDO will correctly error out when it can not allocate memory up to a read
cache size of 31T.  For configurations of 32T or larger VDO will not report
any problems. Smells like a bug.

Comment 4 Jakub Krysl 2017-11-14 15:26:48 UTC
Tested with vdo-6.1.0.46-9:

# vdo create --device=/dev/sda3 --name=vdo --readCacheSize=8000E --readCache=enabled
Usage: vdo --name=<volume>|--all [<option>...] activate|deactivate|create|remove|
                                  start|stop|status|list|modify|
                                  changeWritePolicy|enableDeduplication|
                                  disableDeduplication|enableCompression|
                                  disableCompression|growLogical|growPhysical|
                                  printConfigFile

vdo: error: option --readCacheSize: must be at least 0M and less than 16T

Comment 7 errata-xmlrpc 2018-04-10 15:46:34 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:0871