Bug 2004215 - Cache table line might be incorrectly generated
Summary: Cache table line might be incorrectly generated
Keywords:
Status: POST
Alias: None
Product: LVM and device-mapper
Classification: Community
Component: lvm2
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-14 17:54 UTC by Zdenek Kabelac
Modified: 2023-08-10 15:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:
pm-rhel: lvm-technical-solution?
pm-rhel: lvm-test-coverage?


Attachments (Terms of Use)

Description Zdenek Kabelac 2021-09-14 17:54:32 UTC
Description of problem:

When caching an LV - the table line for such LV might be incorrectly generated.

This however happen only when user supplies some extra cache setting  - which in case of SMQ policy is only 'migration_threshold' which has got explicit handling.

The lvm2 used this incorrect evaluation to get number of args for caching target as discovered here:  https://github.com/lvmteam/lvm2/issues/55


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


Steps to Reproduce:
1. lvcreate -L10 -n lv vg 
2. lvcreate -H -L10 vg/lvol0 --cachepolicy mq --cachesettings 'read_promote_adjustment=10  migration_threshold=4096'

Checking the table give 4 args to target:

metadata2 writethrough mq 4 migration_threshold 4096 read_promote_adjustment 10
                         ^^^ 

Additional info:

Majority of users actually never uses any --cachesettings - and default SMQ accepts only migration_threshold - so the bug was basically unnoticeable.

Comment 1 Zdenek Kabelac 2021-09-14 18:06:38 UTC
Solved upstream this way:

Avoids supplying unsupported cache settings from  MQ & SMQ cache policies
which avoid hitting unpleasant suspend errors:

https://listman.redhat.com/archives/lvm-devel/2021-September/msg00015.html


Enhance revert path when cache table load fails on lvcreate:

https://listman.redhat.com/archives/lvm-devel/2021-September/msg00019.html



Fix actual parentheses errors:

https://listman.redhat.com/archives/lvm-devel/2021-September/msg00035.html


Note You need to log in before you can comment on or make changes to this bug.