]> git.ipfire.org Git - thirdparty/mdadm.git/commit - mdadm.c
Avoid opening md device twice in particular '--assemble' instance.
authorNeilBrown <neilb@suse.de>
Mon, 3 Nov 2008 23:35:35 +0000 (10:35 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 3 Nov 2008 23:35:35 +0000 (10:35 +1100)
commitadf0493cba2355fc3714e6ab265f2b6b7de894d8
tree80d4139498f20054189f4d44723a69a3ebb0a7e6
parent6be1d39d1dafce71c9c7f5bc74ef3fbd30e3765e
Avoid opening md device twice in particular '--assemble' instance.

When
   mdadm --assemble /dev/whatever

is given, mdadm will treat it as though '--scan' were given, even
though it wasn't.
In this case, the code opens /dev/whatever twice, which is pointless.
We already know /dev/whatever is open at this point, so remove the
'open' and the tests, and make sure it is always closed afterwards.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.c