]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- call fsync after writing snapshot info file (bsc#1078336)
authorArvin Schnell <aschnell@suse.de>
Thu, 27 Aug 2020 10:07:54 +0000 (12:07 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 27 Aug 2020 10:07:54 +0000 (12:07 +0200)
LIBVERSION
VERSION
package/snapper.changes
snapper/FileUtils.cc
snapper/FileUtils.h
snapper/Snapshot.cc
snapper/XmlFile.cc

index 0062ac971805f7b700058db4bb0f5c5b771dda76..6b244dcd6960b101b0ab4d9e5162d39632dec80c 100644 (file)
@@ -1 +1 @@
-5.0.0
+5.0.1
diff --git a/VERSION b/VERSION
index 7eff8ab95266441fcf691ea2622287cdcae8f2f5..c2f73c6ecf7c1cc6f599de5ed2a93b43522ac09a 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.8.12
+0.8.13
index 04dc9fbf13b820f3c81d6b0db53778149dc9ea6c..2543b8f67331a0a01e5fde1d2411e75563625e76 100644 (file)
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Thu Aug 27 12:04:44 CEST 2020 - aschnell@suse.com
+
+- call fsync after writing snapshot info file (bsc#1078336)
+- version 0.8.13
+
 -------------------------------------------------------------------
 Thu Jul 23 11:52:31 CEST 2020 - aschnell@suse.com
 
index 7c8f23587841e5109fd39f2f1b837adfcef4c482..0b3c453dc9296ad6f73e3b3257563f7b1fcb30b9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2014] Novell, Inc.
- * Copyright (c) 2018 SUSE LLC
+ * Copyright (c) [2018-2020] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -379,6 +379,13 @@ namespace snapper
     }
 
 
+    int
+    SDir::fsync() const
+    {
+       return ::fsync(dirfd);
+    }
+
+
     int
     SDir::mktemp(string& name) const
     {
index 21eed7972ada35fc6dd7a7a2d490ec4de8cc70bf..3cd2e56e2b3dd473e91b465bdd10dbc3e771a39e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) [2011-2014] Novell, Inc.
+ * Copyright (c) 2020 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -90,6 +91,7 @@ namespace snapper
        int chmod(const string& name, mode_t mode, int flags) const;
        int chown(const string& name, uid_t owner, gid_t group, int flags) const;
        int rename(const string& oldname, const string& newname) const;
+       int fsync() const;
 
        int mktemp(string& name) const;
        bool mkdtemp(string& name) const;
index 89db04728aca4ea18110bc897a1205533a445481..f242d4647807091fcf5d6264d7f20412c5f7af53 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2019] SUSE LLC
+ * Copyright (c) [2016-2020] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -491,6 +491,8 @@ namespace snapper
            SN_THROW(IOErrorException(sformat("rename info.xml failed infoDir:%s errno:%d (%s)",
                                              info_dir.fullname().c_str(), errno,
                                              stringerror(errno).c_str())));
+
+       info_dir.fsync();
     }
 
 
index bf3f6385a6a1d9bce2afe1742e1ac2ae527ea8a6..ee5d9b85260870522cb0e09e30958618ccf94d91 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) [2010-2012] Novell, Inc.
+ * Copyright (c) 2020 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -75,6 +76,8 @@ namespace snapper
            throw IOErrorException("xmlDocFormatDump failed");
        }
 
+       fflush(f);
+       fsync(fileno(f));
        fclose(f);
     }