From: Lennart Poettering Date: Sun, 5 Apr 2015 09:28:04 +0000 (+0200) Subject: machined: drop btrfs subvolumes when removing container images X-Git-Tag: v226.4~1^2~521 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=2c2ecbebd3913607d833617230dc904a05ce0999 machined: drop btrfs subvolumes when removing container images --- diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index c5808af81..f166e9410 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;