From 07a30bb18a642ecec01f13ba670fcee48a8038dc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jul 2019 10:58:49 +0200 Subject: [PATCH] btrfs-util: expose SIGINT behaviour in snapshot copy fallback, too --- src/basic/btrfs-util.c | 2 +- src/basic/btrfs-util.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/basic/btrfs-util.c b/src/basic/btrfs-util.c index 1ee0110e2ff..540a1990ce0 100644 --- a/src/basic/btrfs-util.c +++ b/src/basic/btrfs-util.c @@ -1624,7 +1624,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|COPY_SAME_MOUNT, progress_path, progress_bytes, userdata); + r = copy_directory_fd_full(old_fd, new_path, COPY_MERGE|COPY_REFLINK|COPY_SAME_MOUNT|(FLAGS_SET(flags, BTRFS_SNAPSHOT_SIGINT) ? COPY_SIGINT : 0), progress_path, progress_bytes, userdata); if (r < 0) goto fallback_fail; diff --git a/src/basic/btrfs-util.h b/src/basic/btrfs-util.h index 7d848a75d36..b15667bf2f8 100644 --- a/src/basic/btrfs-util.h +++ b/src/basic/btrfs-util.h @@ -34,6 +34,7 @@ typedef enum BtrfsSnapshotFlags { BTRFS_SNAPSHOT_QUOTA = 1 << 3, BTRFS_SNAPSHOT_FALLBACK_DIRECTORY = 1 << 4, /* If the destination doesn't support subvolumes, reflink/copy instead */ BTRFS_SNAPSHOT_FALLBACK_IMMUTABLE = 1 << 5, /* When we can't create a subvolume, use the FS_IMMUTABLE attribute for indicating read-only */ + BTRFS_SNAPSHOT_SIGINT = 1 << 6, /* Check for SIGINT regularly, and return EINTR if seen */ } BtrfsSnapshotFlags; typedef enum BtrfsRemoveFlags {