Bug 1805892

Summary: wipe_lv ignores write errors when zeroing
Product: Red Hat Enterprise Linux 8 Reporter: David Teigland <teigland>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Other QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: high CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, pasik, prajnoha, zkabelac
Version: 8.4   
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.14-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:21:57 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: 1806563    
Bug Blocks:    

Description David Teigland 2020-02-21 17:12:40 UTC
Description of problem:

The return value of dev_write_zeroes() and dev_set_bytes() is not used,
and errors zeroing are not returned to the caller.

So, for example, if the caller requires an LV to be zeroed, but the LV is
readonly, then the caller will not know that the zeroing failed.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Zdenek Kabelac 2020-09-14 12:34:19 UTC
Solved upstream - final patch in series:

https://www.redhat.com/archives/lvm-devel/2020-August/msg00015.html

Some details about minor change (but rather wanted) in behavior is in bug 1868169.

Comment 11 Corey Marthaler 2021-11-12 16:25:37 UTC
Marking Verified:Tested in the latest rpms

I'm not sure that this is a perfect scenario for this bug, but this LV with zeroing requested was attempted on a VG with one PV RW and one RO, and the create command did notify the user of the failed write. 

kernel-4.18.0-348.4.el8.kpq0    BUILT: Wed Oct 27 15:00:32 CDT 2021
lvm2-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021
lvm2-libs-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021


[root@hayes-01 ~]# lvcreate -Zy  --config devices/scan_lvs=1 -n stack_test -L 600M stack
  Error writing device /dev/base/PVB at 6144 length 2048.
  WARNING: bcache_invalidate: block (1, 0) still dirty.
  Failed to write metadata to /dev/base/PVB.
  Failed to write VG stack.
[root@hayes-01 ~]# lvcreate -Zy -pr  --config devices/scan_lvs=1 -n stack_test -L 600M stack
  Cannot zero read-only logical volume with option -Zy or -Wy.

Comment 17 errata-xmlrpc 2022-05-10 15:21:57 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 (lvm2 bug fix and enhancement update), 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:2038