summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-05 11:28:04 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-06 10:57:53 +0200
commit41d1ed059bbc863c73161f39594de2eb7b338886 (patch)
tree26586f8ecf84bca8480e475b21ccaee2aeb9ee4e /src
parente792e890fe8343b922542f52af09e058f8fa85ab (diff)
machined: drop btrfs subvolumes when removing container images
Diffstat (limited to 'src')
-rw-r--r--src/shared/machine-image.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index c5808af81e..f166e9410d 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -363,11 +363,13 @@ int image_remove(Image *i) {
case IMAGE_DIRECTORY:
/* Allow deletion of read-only directories */
(void) chattr_path(i->path, false, FS_IMMUTABLE_FL);
-
- /* fall through */
+ return rm_rf(i->path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME);
case IMAGE_RAW:
- return rm_rf(i->path, REMOVE_ROOT|REMOVE_PHYSICAL);
+ if (unlink(i->path) < 0)
+ return -errno;
+
+ return 0;
default:
return -EOPNOTSUPP;