* excluded ram block devices from the "valid" list of devices (Closes: #196)
This commit is contained in:
parent
b7f6afcc67
commit
b5c4eabc26
|
@ -46,8 +46,10 @@ LOGGER = logging.getLogger("CryptoNAS")
|
||||||
DEFAULT_SYSBLOCK_DIR = '/sys/block'
|
DEFAULT_SYSBLOCK_DIR = '/sys/block'
|
||||||
DEFAULT_DEVNODE_DIR = '/dev'
|
DEFAULT_DEVNODE_DIR = '/dev'
|
||||||
MINIMUM_STORAGE_SIZE = 10
|
MINIMUM_STORAGE_SIZE = 10
|
||||||
|
# defined device numbers: http://www.lanana.org/docs/device-list/devices.txt
|
||||||
MAJOR_DEVNUM_LOOP = 7
|
MAJOR_DEVNUM_LOOP = 7
|
||||||
MAJOR_DEVNUM_FLOPPY = 2
|
MAJOR_DEVNUM_FLOPPY = 2
|
||||||
|
MAJOR_DEVNUM_RAMDISK = 1
|
||||||
MAJOR_DEVNUM_MD_RAID = 9
|
MAJOR_DEVNUM_MD_RAID = 9
|
||||||
|
|
||||||
## cache settings
|
## cache settings
|
||||||
|
@ -233,6 +235,9 @@ class Blockdevice:
|
||||||
## otherwise we would have a long timeout, while reading the devices
|
## otherwise we would have a long timeout, while reading the devices
|
||||||
if (self.major == MAJOR_DEVNUM_FLOPPY):
|
if (self.major == MAJOR_DEVNUM_FLOPPY):
|
||||||
return False
|
return False
|
||||||
|
# we don't want to store data in ramdisks (e.g. /dev/ram0)
|
||||||
|
if (self.major == MAJOR_DEVNUM_RAMDISK):
|
||||||
|
return False
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue