]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
btrfs: when falling back to plain copy when snapshoting exclude submounts
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 14:13:12 +0000 (15:13 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 15:22:36 +0000 (16:22 +0100)
The subvol snapshot logic doesn't cover sub-mounts either, and it really
shouldn't in the general case, hence let's simply stop at submounts in
all cases, both in the main and in the fall-back codepath.

As discussed here:

https://github.com/systemd/systemd/pull/11243#pullrequestreview-209477230

src/basic/btrfs-util.c

index da4dd2a82707e439db4cf7f3515a8642d347ea92..b1519cc4eb49c3de300f1d2fc743839deb4b990e 100644 (file)
@@ -1628,7 +1628,7 @@ int btrfs_subvol_snapshot_fd_full(
                 } else if (r < 0)
                         return r;
 
-                r = copy_directory_fd_full(old_fd, new_path, COPY_MERGE|COPY_REFLINK, progress_path, progress_bytes, userdata);
+                r = copy_directory_fd_full(old_fd, new_path, COPY_MERGE|COPY_REFLINK|COPY_SAME_MOUNT, progress_path, progress_bytes, userdata);
                 if (r < 0)
                         goto fallback_fail;