Verify an error from ioctl STOP_ARRAY is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Neil,

In a file mdadm/Create.c, line 882, we have a code:


if (fd >= 0)
	remove_partitions(fd);
if (st->ss->add_to_super(st, &inf->disk,
			 fd, dv->devname)) {
	ioctl(mdfd, STOP_ARRAY, NULL);
	goto abort;
}
st->ss->getinfo_super(st, inf, NULL);
safe_mode_delay = inf->safe_mode_delay;


We don't verify a error code from "ioctl", in my tests I get sometimes
"errno: 16, Device or resource busy" from ioctl. If it happens, mdadm
finishes the job and md device (for example "/dev/md126") is still active,
and it shouldn't.

I think a correct path should be:
- create md device
- error from function "add_to_super"
- remove md device (by using ioctl STOP_ARRAY)
- finish program

What do you think about this? What kind of patch do we need to fix this
problem, if any? I think we could retry to call ioctl until it will be
successful, and add some limit of attempts or timeout (but then problem can
still appear).

In mdadm there is more unverified error codes from ioctl, which they can
cause unwanted problems. Shouldn't we check all of these error codes?

Regards
Marcin Tomczak

<<attachment: smime.p7s>>

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux