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:
parent
2acab355ec
commit
398cb1dc4f
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue