From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: stable-2.02 - filters: persistent filter hides rename failure
Date: Fri, 23 Oct 2020 23:38:04 +0000 (GMT) [thread overview]
Message-ID: <20201023233804.2AF0E3858003@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e478ef2f59da65ebf47ca7a1534f112669858d5a
Commit: e478ef2f59da65ebf47ca7a1534f112669858d5a
Parent: f33ccaee45eb75c3aeac8a6647997de87ff3f207
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sat Oct 24 01:27:19 2020 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
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(-)
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index 058694228..afd7eb541 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -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;
reply other threads:[~2020-10-23 23:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201023233804.2AF0E3858003@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.