stable-2.02 - filters: persistent filter hides rename failure
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e478ef2f59da65ebf47ca7a1534f112669858d5a Commit: e478ef2f59da65ebf47ca7a1534f112669858d5a Parent: f33ccaee45eb75c3aeac8a6647997de87ff3f207 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Oct 24 01:27:19 2020 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sat Oct 24 01:31:40 2020 +0200
filters: persistent filter hides rename failure
Filters are saved on command's exit path - and as such they are not protected by any locks.
This means 2 running commands may 'race' here and 2nd. command may have already renamed filename for the 1st. command. So if the rename fails here - we will only use log_sys_debug, as the failure doesn't cause command failure result.
--- lib/filters/filter-persistent.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/filters/filter-persistent.c +1 -2
@@ -272,8 +272,7 @@ static int _persistent_filter_dump(struct dev_filter *f, int merge_existing) goto_out;if (rename (tmp_file, pf->file)) -log_error ("%s: rename to %s failed: %s" , tmp_file, pf->file, -strerror (errno)); +log_sys_debug ("rename" , tmp_file); r =1 ;