mirror of
				https://github.com/vdsm/virtual-dsm.git
				synced 2025-11-04 08:54:51 +08:00 
			
		
		
		
	
							parent
							
								
									698516ac8c
								
							
						
					
					
						commit
						87fad1b0e9
					
				
							
								
								
									
										14
									
								
								src/disk.sh
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/disk.sh
									
									
									
									
									
								
							@ -261,7 +261,7 @@ convertDisk() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
checkFS () {
 | 
					checkFS () {
 | 
				
			||||||
  local DISK_FILE=$1
 | 
					  local DISK_FILE=$1
 | 
				
			||||||
  local DIR FS FA
 | 
					  local DIR FS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DIR=$(dirname "$DISK_FILE")
 | 
					  DIR=$(dirname "$DISK_FILE")
 | 
				
			||||||
  [ ! -d "$DIR" ] && return 0
 | 
					  [ ! -d "$DIR" ] && return 0
 | 
				
			||||||
@ -282,11 +282,15 @@ checkFS () {
 | 
				
			|||||||
      fi
 | 
					      fi
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [ -f "$DISK_FILE" ] ; then
 | 
					    local FA=""
 | 
				
			||||||
      FA=$(lsattr "$DISK_FILE")
 | 
					    [ -f "$DISK_FILE" ] && FA=$(lsattr "$DISK_FILE")
 | 
				
			||||||
      [[ "$FA" == *"C"* ]] && FA=$(lsattr -d "$DIR")
 | 
					
 | 
				
			||||||
    else
 | 
					    if [[ "$FA" == "" || "$FA" == *"C"* ]]; then
 | 
				
			||||||
      FA=$(lsattr -d "$DIR")
 | 
					      FA=$(lsattr -d "$DIR")
 | 
				
			||||||
 | 
					      if [[ "$FA" != *"C"* ]]; then
 | 
				
			||||||
 | 
					        { chattr -R +C "$DIR"; } || :
 | 
				
			||||||
 | 
					        FA=$(lsattr -d "$DIR")
 | 
				
			||||||
 | 
					      fi      
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ "$FA" != *"C"* ]]; then
 | 
					    if [[ "$FA" != *"C"* ]]; then
 | 
				
			||||||
 | 
				
			|||||||
@ -54,8 +54,13 @@ FS=$(stat -f -c %T "$STORAGE")
 | 
				
			|||||||
if [[ "$FS" == "overlay"* ]]; then
 | 
					if [[ "$FS" == "overlay"* ]]; then
 | 
				
			||||||
  info "Warning: the filesystem of $STORAGE is OverlayFS, this usually means it was binded to an invalid path!"
 | 
					  info "Warning: the filesystem of $STORAGE is OverlayFS, this usually means it was binded to an invalid path!"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ "$FS" == "xfs" || "$FS" == "zfs" || "$FS" == "btrfs" || "$FS" == "bcachefs" ]]; then
 | 
					if [[ "$FS" == "xfs" || "$FS" == "zfs" || "$FS" == "btrfs" || "$FS" == "bcachefs" ]]; then
 | 
				
			||||||
  FA=$(lsattr -d "$STORAGE")
 | 
					  FA=$(lsattr -d "$STORAGE")
 | 
				
			||||||
 | 
					  if [[ "$FA" != *"C"* ]]; then
 | 
				
			||||||
 | 
					    { chattr -R +C "$STORAGE"; } || :
 | 
				
			||||||
 | 
					    FA=$(lsattr -d "$STORAGE")
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
  if [[ "$FA" != *"C"* ]]; then  
 | 
					  if [[ "$FA" != *"C"* ]]; then  
 | 
				
			||||||
    info "Warning: the filesystem of $STORAGE is ${FS^^}, and COW (copy on write) is not disabled for that folder!"
 | 
					    info "Warning: the filesystem of $STORAGE is ${FS^^}, and COW (copy on write) is not disabled for that folder!"
 | 
				
			||||||
    info "This will negatively affect performance, please empty the folder and disable COW (chattr +C <path>)."
 | 
					    info "This will negatively affect performance, please empty the folder and disable COW (chattr +C <path>)."
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user