[bug] dmraid, lack of error handling

"Molle Bestefich" <[email protected]>
Newsgroups gmane.linux.ataraid
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.