summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2019-02-09 13:44:56 +0000
committerDimitri John Ledkov <xnox@ubuntu.com>2019-02-09 13:46:30 +0000
commit37b01ad3834eb6d45b96a30a469f042f5190fe65 (patch)
tree792d97274774acfee5ce51cfb7cfaf97e4161ccd
parenta252a2db8e9e5f1ad4cf7a235d19615b9a175bfd (diff)
Fix btrfs send of snapshots stored in /. Closes: #920886.HEADdebian/4.20.1-2archive/debian/4.20.1-2master
-rw-r--r--debian/changelog6
-rw-r--r--debian/patches/fix-rootfs-snapshot.patch15
-rw-r--r--debian/patches/series1
-rw-r--r--utils.c2
4 files changed, 23 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index ca405e4d..9cf7c6b2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+btrfs-progs (4.20.1-2) unstable; urgency=medium
+
+ * Fix btrfs send of snapshots stored in /. Closes: #920886.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com> Sat, 09 Feb 2019 13:43:54 +0000
+
btrfs-progs (4.20.1-1) unstable; urgency=medium
* New upstream release
diff --git a/debian/patches/fix-rootfs-snapshot.patch b/debian/patches/fix-rootfs-snapshot.patch
new file mode 100644
index 00000000..02247a44
--- /dev/null
+++ b/debian/patches/fix-rootfs-snapshot.patch
@@ -0,0 +1,15 @@
+Description: Fix taking snapshots of '/' itself
+Bug: https://github.com/kdave/btrfs-progs/issues/162
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920886
+
+--- a/utils.c
++++ b/utils.c
+@@ -2079,7 +2079,7 @@ int find_mount_root(const char *path, ch
+ while ((ent = getmntent(mnttab))) {
+ len = strlen(ent->mnt_dir);
+ if (strncmp(ent->mnt_dir, path, len) == 0 &&
+- (path[len] == '/' || path[len] == '\0')) {
++ (len == 1 || path[len] == '/' || path[len] == '\0')) {
+ /* match found and use the latest match */
+ if (longest_matchlen <= len) {
+ free(longest_match);
diff --git a/debian/patches/series b/debian/patches/series
index c010bd16..d3a965aa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
python3-use-deb-layout.patch
+fix-rootfs-snapshot.patch
diff --git a/utils.c b/utils.c
index 2c60ef21..c0f3a3b3 100644
--- a/utils.c
+++ b/utils.c
@@ -2079,7 +2079,7 @@ int find_mount_root(const char *path, char **mount_root)
while ((ent = getmntent(mnttab))) {
len = strlen(ent->mnt_dir);
if (strncmp(ent->mnt_dir, path, len) == 0 &&
- (path[len] == '/' || path[len] == '\0')) {
+ (len == 1 || path[len] == '/' || path[len] == '\0')) {
/* match found and use the latest match */
if (longest_matchlen <= len) {
free(longest_match);