[bug] dmraid, lack of error handling

Molle Bestefich molle.bestefich at gmail.com
Thu Jul 6 07:58:45 UTC 2006


dmraid seems to lack proper error handling when the dm-mod module is not loaded.

# dmraid -tay -vvv
 ... lots of output, arrays discovered
# dmraid -ay
 ... no output at all, looks fine!
# ls /dev/mapper
control
... Huh, no devices created?

Once I did "strace dmraid -ay", I finally figured out that I had
"forgotten" to do "modprobe dm-mod":
# strace dmraid -ay
... snip
stat64("/dev/mapper/control", {st_mode=S_IFCHR|0644,
st_rdev=makedev(10, 63), ...}) = 0
open("/dev/mapper/control", O_RDWR|O_LARGEFILE) = -1 ENODEV (No such device)
unlink("/var/lock/dmraid/.lock")        = 0
flock(3, LOCK_NB|LOCK_UN)               = 0
close(3)                                = 0
exit_group(0)                           = ?

Above, /dev/mapper/control file exists, but opening it gives ENODEV.

I think dmraid lacks error handling in two more places, too:
- when the /dev/mapper directory does not exists,
- when the /dev/mapper/control device does not exist.

It would be very helpful if proper error messages were printed, insted
of just exiting with code 0.




More information about the Ataraid-list mailing list