Bug 1899206

Summary: [RFE] LVM Thin: Add ability to set pool metadata area to read-only
Product: [Community] LVM and device-mapper Reporter: Zdenek Kabelac <zkabelac>
Component: lvm2Assignee: LVM Team <lvm-team>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, prajnoha, thornber, zkabelac
Version: unspecifiedKeywords: FutureFeature
Target Milestone: ---Flags: pm-rhel: lvm-technical-solution?
pm-rhel: lvm-test-coverage?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: 1163873 Environment:
Last Closed: Type: ---
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: 1163873    
Bug Blocks: 1119323    

Description Zdenek Kabelac 2020-11-18 18:00:01 UTC
Allow setting a pool to read-only-metadata mode.  This allows writes to the thins so long as they don't access unprovisioned areas.

--- Additional comment from Zdenek Kabelac on 2015-06-19 19:47:05 UTC ---

Add for now lidbm function dm_tree_node_set_thin_pool_read_only()
with upstream patch.

https://www.redhat.com/archives/lvm-devel/2015-June/msg00054.html

Yet it's not quite clear what we should propose as lvm2 user API for this feature.

As the closest match with current lvm2 tools see we could see similarities with 'pvchange --allocateable y|n'.

So something like:  'lvchange --allocateable y|n  vg/pool' looks good - although the actual logic in thin-pool kernel target is slightly different, since kernel module avoid any modification of pool metadata - so it's not purely 'allocation related.

Other issue is - if user switch to 'read-only' mode - then ordinary filesystems do not handle well the case when some writes proceeds and some fail - but user should probably always use  'error-remount-ro' filesystem with thin volumes anyway.