]> git.baikalelectronics.ru Git - kernel.git/commit
md: return -ENODEV if rdev has no mddev assigned
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Wed, 27 Mar 2019 12:48:21 +0000 (13:48 +0100)
committerSong Liu <songliubraving@fb.com>
Tue, 16 Apr 2019 16:31:21 +0000 (09:31 -0700)
commitf94d26579c65d534928adea0f3b7272164261b25
tree01daefa659700d4d088696e3e4be9284280867a8
parent725661ed7193cdf831011d4c96c8ecfd8c410e35
md: return -ENODEV if rdev has no mddev assigned

Mdadm expects that setting drive as faulty will fail with -EBUSY only if
this operation will cause RAID to be failed. If this happens, it will
try to stop the array. Currently -EBUSY might also be returned if rdev
is in the middle of the removal process - for example there is a race
with mdmon that already requested the drive to be failed/removed.

If rdev does not contain mddev, return -ENODEV instead, so the caller
can distinguish between those two cases and behave accordingly.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c