mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
In certain configurations, we're not under a VG rw lock while trying to write a new archive file with VG metadata. A common example is using "vgs" while having the content of backup and archive directories empty. The code scans the content of these directories and tries to determine the final index that should be used in archive name. Since we're not under a lock, we can get into a race while choosing the index which could end up showing errors about not being able to rename to final archive name. Let's add random number suffix to these archive file names so we can avoid the race.