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 1668747

Summary: vdostats displays a large number for volumes started in read-only mode
Product: Red Hat Enterprise Linux 8 Reporter: Bryan Gurney <bgurney>
Component: vdoAssignee: sclafani
Status: CLOSED ERRATA QA Contact: vdo-qe
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: awalsh, msakai, rhandlin
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.2.1.6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:12:24 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: 1682564    
Bug Blocks:    

Description Bryan Gurney 2019-01-23 13:50:42 UTC
Description of problem:

In VDO 6.1.1 in RHEL 7.6, a read-only VDO volume displayed a "data blocks used" statistics of "N/A", which would result in a "vdostats --verbose" display resembling the following:

vdo : 
  version                             : 28
  release version                     : 131337
  data blocks used                    : N/A
  overhead blocks used                : 940924
  logical blocks used                 : 0
  physical blocks                     : 217849600
  logical blocks                      : 104857600
  1K-blocks                           : 871398400
  1K-blocks used                      : N/A
  1K-blocks available                 : N/A
  used percent                        : N/A
  saving percent                      : N/A

(This is with the value in /sys/kvdo/vdo1/statistics/data_blocks_used being "0".)

In VDO 6.2.0 on RHEL 8, a read-only VDO volume seems to display the value of "data blocks used", even if the volume is read-only.

vdo1 : 
  version                             : 30
  release version                     : 133524
  data blocks used                    : 0
  overhead blocks used                : 1065312
  logical blocks used                 : 0
  physical blocks                     : 26214144
  logical blocks                      : 104857600
  1K-blocks                           : 104856576
  1K-blocks used                      : 4261248
  1K-blocks available                 : 100595328
  used percent                        : 4
  saving percent                      : 0
  block map cache size                : 134217728
  write policy                        : sync
  block size                          : 4096
  completed recovery count            : 0
  read-only recovery count            : 0
  operating mode                      : read-only

If the "data blocks used" value is non-zero prior to the read-only event, a very large number may appear.  This is after having executed "mkfs.xfs -K /dev/mapper/vdo1" on the volume, prior to triggering read-only mode:

vdo1 : 
  version                             : 30
  release version                     : 133524
  data blocks used                    : 18446744073709551365
  overhead blocks used                : 1065563
  logical blocks used                 : 51291
  physical blocks                     : 26214144
  logical blocks                      : 104857600
  1K-blocks                           : 104856576
  1K-blocks used                      : 73786976294842467712
  1K-blocks available                 : -73786976294737611136
  used percent                        : 70369431379146
  saving percent                      : 0
  block map cache size                : 134217728
  write policy                        : sync
  block size                          : 4096
  completed recovery count            : 0
  read-only recovery count            : 0
  operating mode                      : read-only

(Note that in both RHEL 7.6 and RHEL 8.0, /sys/kvdo/vdo1/statistics/data_blocks_used says 18446744073709551365.  However, the vdostats program from vdo-6.1.1.125 displays "N/A" for the "data blocks used" field, and the other calculated fields.)

Version-Release number of selected component (if applicable):
kernel-4.18.0-63.el8.x86_64
kmod-kvdo-6.2.0.293-44.el8.x86_64
vdo-6.2.0.293-10.el8.x86_64


How reproducible:


Steps to Reproduce:
1. vdo create --name=vdo1 --device=/dev/nvme0n1p1 --vdoLogicalSize=400G
2. vdostats --verbose vdo1 | grep data\ blocks\ used
3. mkfs.xfs -K /dev/mapper/vdo1
4. vdostats --verbose vdo1 | grep data\ blocks\ used
5. vdo stop --name=vdo1
6. vdoreadonly /dev/nvme0n1p1
7. vdo start --name=vdo1
8. vdostats --verbose vdo1 | grep data\ blocks\ used


Actual results:
The "vdostats --verbose" command displays a very large number for VDO volumes that previously had a nonzero "data blocks used" statistic.

Expected results:
The "vdostats --verbose" command displays "N/A" for "data blocks used".

Additional info:

RHEL 7 / VDO 6.1.1 comparison point versions:

kernel-3.10.0-957.1.3.el7.x86_64
vdo-6.1.1.125-3.el7.x86_64
kmod-kvdo-6.1.1.125-5.el7.x86_64

Comment 1 Bryan Gurney 2019-01-23 14:12:29 UTC
How reproducible: seems to be 100%, as long as at least one data block is written.  (I've only had enough time to run "mkfs.xfs -K" on the VDO volume so far).

Here's what the non-verbose vdostats output looks like (on the RHEL 8 test system):

# vdostats
Device               1K-blocks      Used Available Use% Space saving%
/dev/mapper/vdo1     104856576 73786976294842467712 -73786976294737611136 70369431379146%            0%

# dmsetup status vdo1
0 838860800 vdo /dev/nvme0n1p1 read-only - online online 1065312 26214144

Comment 6 Jakub Krysl 2019-07-25 12:12:18 UTC
kmod-kvdo-6.2.1.102-53.el8.x86_64
kernel-4.18.0-107.el8.x86_64
vdo-6.2.1.102-11.el8.x86_64

# vdo create --name=vdo1 --device=/dev/sda --vdoLogicalSize=400G
Creating VDO vdo1
Starting VDO vdo1
Starting compression on VDO vdo1
VDO instance 0 volume is ready at /dev/mapper/vdo1

# vdostats --verbose vdo1 | grep data\ blocks\ used
  data blocks used                    : 0

# mkfs.xfs -K /dev/mapper/vdo1
meta-data=/dev/mapper/vdo1       isize=512    agcount=4, agsize=26214400 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=104857600, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=51200, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
# vdostats --verbose vdo1 | grep data\ blocks\ used
  data blocks used                    : 6

# vdo stop --name vdo1
Stopping VDO vdo1

# vdoreadonly /dev/sda

# vdo start --name vdo1
Starting VDO vdo1
Starting compression on VDO vdo1
VDO instance 1 volume is ready at /dev/mapper/vdo1

# vdostats --verbose vdo1 | grep data\ blocks\ used
  data blocks used                    : N/A

Comment 9 errata-xmlrpc 2019-11-05 22:12:24 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/RHBA-2019:3548