Bug 858113

Summary: --discards doesn't work with lvcreate and the default is ignore not passdown.
Product: Red Hat Enterprise Linux 7 Reporter: Xiaowei Li <xiaoli>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Default / Unclassified QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: high    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, qcai, thornber, zkabelac
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-07 07:01:01 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 Xiaowei Li 2012-09-18 02:24:20 UTC
Description of problem:
--discards doesn't work with lvcreate and the default is ignore not passdown.

Version-Release number of selected component (if applicable):
lvm2-2.02.97-1.el7.x86_64

How reproducible:


Steps to Reproduce:
1. man lvcreate
===
       --discards {ignore|nopassdown|passdown}
              Set discards behavior.  Default is passdown.
===

2. create thin pool with --discards
# lvcreate -L16m -T tsvg/pool1 
# lvcreate -L16m -T tsvg/pool2 --discards nopassdown

3. # lvs -ovg_name,lv_name,discards tsvg
  VG   LV    Discards
  tsvg pool1   ignore
  tsvg pool2   ignore
  
# dmsetup table --target thin-pool
tsvg-pool1-tpool: 0 32768 thin-pool 253:1 253:2 128 0 1 ignore_discard 
tsvg-pool2-tpool: 0 32768 thin-pool 253:5 253:6 128 0 1 ignore_discard 

from the debug log:
===
#lvmcmdline.c:1087         Processing: lvcreate -L16m -T tsvg/pool3 --discards nopassdown -vvvv
>>>snip>>>
#libdm-deptree.c:2324         Adding target to (253:12): 0 32768 thin-pool 253:10 253:11 128 0 1 ignore_discard
===

Actual results:


Expected results:


Additional info:

Comment 1 Zdenek Kabelac 2012-09-19 09:49:42 UTC
Already fixed in upstream:

https://www.redhat.com/archives/lvm-devel/2012-August/msg00062.html

(Before the release of lvm2-2.02.97, there were some changes that've missed to update some related code parts)

Comment 2 Xiaowei Li 2012-11-14 03:53:54 UTC
verified with lvm2-2.02.98-2.el7.x86_64