mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-14 05:53:42 +08:00
14
src/disk.sh
14
src/disk.sh
@@ -261,7 +261,7 @@ convertDisk() {
|
||||
|
||||
checkFS () {
|
||||
local DISK_FILE=$1
|
||||
local DIR FS FA
|
||||
local DIR FS
|
||||
|
||||
DIR=$(dirname "$DISK_FILE")
|
||||
[ ! -d "$DIR" ] && return 0
|
||||
@@ -282,11 +282,15 @@ checkFS () {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$DISK_FILE" ] ; then
|
||||
FA=$(lsattr "$DISK_FILE")
|
||||
[[ "$FA" == *"C"* ]] && FA=$(lsattr -d "$DIR")
|
||||
else
|
||||
local FA=""
|
||||
[ -f "$DISK_FILE" ] && FA=$(lsattr "$DISK_FILE")
|
||||
|
||||
if [[ "$FA" == "" || "$FA" == *"C"* ]]; then
|
||||
FA=$(lsattr -d "$DIR")
|
||||
if [[ "$FA" != *"C"* ]]; then
|
||||
{ chattr -R +C "$DIR"; } || :
|
||||
FA=$(lsattr -d "$DIR")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$FA" != *"C"* ]]; then
|
||||
|
||||
Reference in New Issue
Block a user