From 0b3e92bc78ff45b75bf9a7edc76d9fc76e1d1cb2 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 20 Jan 2004 03:11:51 -0800 Subject: [PATCH] [PATCH] md: fix return code in set_disk_faulty() From: NeilBrown Following are 10 patches for md in 2.6.1-lastest. 1-6 are simple bugfixes that I am confident should be in 2.6.2. 7 is a bugfix that is fairly important, but could probably do with a bit more testing first. It is not impossible that it could deadlock, though I think I have caught and fixed all the problems. 8-10 are code simplication. So maybe 7-10 should only go in -mm for now, but if it is a while before 2.6.2, then maybe they can go in a 2.6.2-pre. From: Mike Tran If cannot find the device, return error (ENODEV) Otherwise, return success (0) --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 67253852346a2..ba0562e6e2e95 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2356,10 +2356,10 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev) rdev = find_rdev(mddev, dev); if (!rdev) - return 0; + return -ENODEV; md_error(mddev, rdev); - return 1; + return 0; } static int md_ioctl(struct inode *inode, struct file *file, -- 2.53.0