diff options
author | David Teigland <teigland@redhat.com> | 2022-09-14 09:13:58 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-09-14 14:19:29 -0500 |
commit | 0887896847807e159a70edc5ac92a4030c13923a (patch) | |
tree | 9d84b79ae450559d83b51d2ce9fdfeadd3ee58a9 /tools/pvscan.c | |
parent | a2d33cdfc516d946d390645cc694e745008b6fc0 (diff) | |
download | lvm2-0887896847807e159a70edc5ac92a4030c13923a.tar.gz |
vgremove: remove online files in run dir
These files are automatically cleared on reboot given
that /run is tmpfs, and that remains the primary way
of clearing online files.
But, if there's extreme use of vgcreate+pvscan+vgremove
between reboots, then removing online files in vgremove
will limit the number of unused online files using space
in /run.
Diffstat (limited to 'tools/pvscan.c')
-rw-r--r-- | tools/pvscan.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c index 72c3279c3..1c58e4a5b 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -177,21 +177,6 @@ out: return ret; } -static void _lookup_file_remove(char *vgname) -{ - char path[PATH_MAX]; - - if (dm_snprintf(path, sizeof(path), "%s/%s", PVS_LOOKUP_DIR, vgname) < 0) { - log_error("Path %s/%s is too long.", PVS_LOOKUP_DIR, vgname); - return; - } - - log_debug("Unlink pvs_lookup: %s", path); - - if (unlink(path) && (errno != ENOENT)) - log_sys_debug("unlink", path); -} - /* * When a device goes offline we only know its major:minor, not its PVID. * Since the dev isn't around, we can't read it to get its PVID, so we have to @@ -233,7 +218,7 @@ static void _online_pvid_file_remove_devno(int major, int minor) if (file_vgname[0]) { online_vg_file_remove(file_vgname); - _lookup_file_remove(file_vgname); + online_lookup_file_remove(file_vgname); } } } |