mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
Fixes subvol delete on a non-btrfs volume
Inode numbers are guaranteed to be unique only within a filesystem. As such there is an edge case where these predicates are true on a non-btrfs filesystem. Closes #42271 Signed-off-by: Brett Milford <brettmilford@gmail.com>
This commit is contained in:
@@ -61,10 +61,12 @@ if command -v btrfs > /dev/null 2>&1; then
|
||||
# Source: http://stackoverflow.com/a/32865333
|
||||
for subvol in $(find "$dir" -type d -inum 256 | sort -r); do
|
||||
if [ "$dir" != "$subvol" ]; then
|
||||
(
|
||||
set -x
|
||||
btrfs subvolume delete "$subvol"
|
||||
)
|
||||
if [ "$(stat -f --format=%T $subvol)" == "btrfs" ]; then
|
||||
(
|
||||
set -x
|
||||
btrfs subvolume delete "$subvol"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user