1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

machined: drop btrfs subvolumes when removing container images

This commit is contained in:
Lennart Poettering 2015-04-05 11:28:04 +02:00
parent e792e890fe
commit 41d1ed059b

View File

@ -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;