Add sfx filesystem and unknown fs handling

This commit is contained in:
Riccardo Biraghi
2018-06-19 15:27:11 +01:00
parent bff2f6bfae
commit 0f9cd3f204

View File

@@ -33,6 +33,7 @@ var fsTypes = map[int64]string{
0x9123683e: "btrfs", 0x9123683e: "btrfs",
0x01021994: "tmpfs", 0x01021994: "tmpfs",
0x794c7630: "overlayfs", 0x794c7630: "overlayfs",
0x58465342: "xfs",
} }
func checkFS(path string) error { func checkFS(path string) error {
@@ -43,7 +44,11 @@ func checkFS(path string) error {
return nil return nil
} }
// Use a type conversion to make type an int64. On s390x it's a uint32. // Use a type conversion to make type an int64. On s390x it's a uint32.
t := fsTypes[int64(statfs.Type)] t, ok := fsTypes[int64(statfs.Type)]
if !ok {
log.Printf("WARNING: detected %v has unknown filesystem type %x", path, statfs.Type)
return nil
}
switch t { switch t {
case "aufs", "overlayfs", "tmpfs": case "aufs", "overlayfs", "tmpfs":
return fmt.Errorf("%v uses unsupported filesystem type: %v", path, t) return fmt.Errorf("%v uses unsupported filesystem type: %v", path, t)