Re: [Regression] Please revert a91a2785b20

From: Martin K. Petersen
Date: Mon Mar 28 2011 - 20:09:54 EST


>>>>> "Thomas" == Thomas Gleixner <tglx@xxxxxxxxxxxxx> writes:

Thomas> Why didn't you send a revert to Linus right away?

Simply didn't think of it. Didn't get the bug report until this
afternoon and few people build with BLK_DEV_INTEGRITY enabled. But I
guess Fedora has it on by default.


Thomas> So for your thing, it was already in Linus tree. Though if you
Thomas> get aware of it and it's revertable w/o creating lots of mess,
Thomas> then it's the right thing to revert it immediately. Do not drag
Thomas> out regressions longer than necessary, please.

Noted.

Patch below...

--
Martin K. Petersen Oracle Linux Engineering


[PATCH] md: Fix integrity registration error when no devices are capable

We incorrectly returned -EINVAL when none of the devices in the array
had an integrity profile. This in turn prevented mdadm from starting the
metadevice. Fix this so we only return errors on mismatched profiles and
memory allocation failures.

Reported-by: Giacomo Catenazzi <cate@xxxxxxxxxx>
Reported-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index f11e0bc..aab112f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1778,12 +1778,6 @@ int md_integrity_register(mddev_t *mddev)
continue;
if (rdev->raid_disk < 0)
continue;
- /*
- * If at least one rdev is not integrity capable, we can not
- * enable data integrity for the md device.
- */
- if (!bdev_get_integrity(rdev->bdev))
- return -EINVAL;
if (!reference) {
/* Use the first rdev as the reference */
reference = rdev;
@@ -1794,6 +1788,8 @@ int md_integrity_register(mddev_t *mddev)
rdev->bdev->bd_disk) < 0)
return -EINVAL;
}
+ if (!reference || !bdev_get_integrity(reference->bdev))
+ return 0;
/*
* All component devices are integrity capable and have matching
* profiles, register the common profile for the md device.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/