mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mike Snitzer <snizer@redhat.com>,
	James Bottomley <James.Bottomley@suse.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Ingo Molnar <mingo@elte.hu>,
	Giacomo Catenazzi <cate@cateee.net>
Subject: Re: [Regression] Please revert a91a2785b20
Date: Mon, 28 Mar 2011 20:09:12 -0400	[thread overview]
Message-ID: <yq1d3lakct3.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1103290049330.2774@localhost6.localdomain6> (Thomas Gleixner's message of "Tue, 29 Mar 2011 01:03:17 +0200 (CEST)")

>>>>> "Thomas" == Thomas Gleixner <tglx@linutronix.de> 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@cateee.net>
Reported-by: Thomas Gleixner <tglx@linutronix.de>

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.

  reply	other threads:[~2011-03-29  0:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 22:35 Thomas Gleixner
2011-03-28 22:43 ` Thomas Gleixner
2011-03-28 23:03   ` Mike Snitzer
2011-03-29  6:59     ` Jens Axboe
2011-03-29 13:20       ` Mike Snitzer
2011-03-29 13:35         ` James Bottomley
2011-03-29 13:42         ` Martin K. Petersen
2011-03-29 13:58           ` Need to refactor DM's integrity profile support a bit (was: Re: Please revert a91a2785b20) Mike Snitzer
2011-04-01 17:42             ` [PATCH] dm: improve block integrity support Mike Snitzer
2011-04-14 14:09               ` Mike Snitzer
2011-04-14 14:42                 ` Mike Snitzer
2011-04-15  4:57                   ` Martin K. Petersen
2011-04-05  2:09           ` Please revert a91a2785b20 NeilBrown
2011-03-28 22:45 ` [Regression] " Martin K. Petersen
2011-03-28 23:03   ` Thomas Gleixner
2011-03-29  0:09     ` Martin K. Petersen [this message]
2011-03-29  0:11       ` Martin K. Petersen
2011-03-29  2:32       ` Thomas Gleixner
2011-03-29  5:32       ` Giacomo Catenazzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yq1d3lakct3.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=James.Bottomley@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cate@cateee.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=snizer@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome