Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
lvm2
bug-1142550_02-LVM-vg-are-not-being-cleaned-up-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bug-1142550_02-LVM-vg-are-not-being-cleaned-up-after-kiwi-image-build.patch of Package lvm2
The fix is making invalid partitions of loop device won't pass the filter. So the lvmetad can't handle this broken device. Author: lidong.zhong@suse.com Reviewed-by: heming.zhao@suse.com Index: LVM2.2.02.120/lib/filters/filter-partitioned.c =================================================================== diff -Nupr a/lib/filters/filter-partitioned.c b/lib/filters/filter-partitioned.c --- a/lib/filters/filter-partitioned.c 2022-11-23 09:05:34.019086913 +0800 +++ b/lib/filters/filter-partitioned.c 2022-11-23 09:23:45.615086913 +0800 @@ -18,9 +18,33 @@ #define MSG_SKIPPING "%s: Skipping: Partition table signature found" +static int _loop_is_with_partscan(dev_t dev) +{ + FILE *fp; + int partscan = 1; + char path[PATH_MAX]; + + if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d/loop/partscan", + dm_sysfs_dir(), + (int) MAJOR(dev), + (int) MINOR(dev)) < 0) { + log_warn("Sysfs path for partscan is too long."); + return 0; + } + + if (!(fp = fopen(path, "r"))) + return 0; /* not there -> no partscan */ + + if (fclose(fp)) + log_sys_debug("fclose", path); + + return partscan; +} + static int _passes_partitioned_filter(struct dev_filter *f, struct device *dev) { struct dev_types *dt = (struct dev_types *) f->private; + dev_t devt; int ret; ret = dev_is_partitioned(dt, dev); @@ -41,6 +65,14 @@ static int _passes_partitioned_filter(st return 0; } + /*check if it's a valid loop partition*/ + if (MAJOR(dev->dev) == dt->blkext_major && (2 == dev_get_primary_dev(dt, dev, &devt))) { + if(MAJOR(devt) == dt->loop_major && !_loop_is_with_partscan(devt)) { + log_debug_devs("Partitioned filter skip invalide loop partition: %s.", dev_name(dev)); + return 0; + } + } + return 1; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor