mirror of
https://github.com/minio/minio.git
synced 2025-11-26 04:26:12 -05:00
fix: for containers use root-disk detection cleverly (#11593)
root-disk implemented currently had issues where root disk partitions getting modified might race and provide incorrect results, to avoid this lets rely again back on DeviceID and match it instead. In-case of containers `/data` is one such extra entity that needs to be verified for root disk, due to how 'overlay' filesystem works and the 'overlay' presents a completely different 'device' id - using `/data` as another entity for fallback helps because our containers describe 'VOLUME' parameter that allows containers to automatically have a virtual `/data` that points to the container root path this can either be at `/` or `/var/lib/` (on different partition)
This commit is contained in:
@@ -25,13 +25,5 @@ func IsRootDisk(diskPath string, rootDisk string) (bool, error) {
|
||||
// On windows this function is not implemented.
|
||||
return false, nil
|
||||
}
|
||||
info, err := GetInfo(diskPath)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
rootInfo, err := GetInfo(rootDisk)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return SameDisk(info, rootInfo), nil
|
||||
return SameDisk(diskPath, rootDisk)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user