From: Neil Brown <neilb@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: jens.axboe@oracle.com, linux-kernel@vger.kernel.org,
linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: Add support for data integrity to MD
Date: Wed, 24 Sep 2008 12:46:08 +1000 [thread overview]
Message-ID: <18649.43504.157272.351801@notabene.brown> (raw)
In-Reply-To: message from Martin K. Petersen on Saturday September 20
On Saturday September 20, martin.petersen@oracle.com wrote:
>
> If all subdevices support the same protection format the MD device is
> flagged as capable.
But what if we subsequently add a different device to that array which
uses a different protection format. Would we be able to tell the
filesystem that integrity protection isn't available any more?
Or can we detect if the filesystem is using integrity protection, and
reject the new device if it doesn't match?
In either case, some extra handling is needed in bind_rdev_to_array.
NeilBrown
>
> Depends on d7533ad0e132f92e75c1b2eb7c26387b25a583c1 being reverted.
>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
> drivers/md/md.c | 32 +++++++++++++++++++++++++++++++-
> 1 files changed, 31 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 45521da..b038581 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -3497,7 +3497,7 @@ static int do_md_run(mddev_t * mddev)
> int err;
> int chunk_size;
> struct list_head *tmp;
> - mdk_rdev_t *rdev;
> + mdk_rdev_t *rdev, *prev;
> struct gendisk *disk;
> struct mdk_personality *pers;
> char b[BDEVNAME_SIZE];
> @@ -3759,6 +3759,35 @@ static int do_md_run(mddev_t * mddev)
> sysfs_notify(&mddev->kobj, NULL, "sync_action");
> sysfs_notify(&mddev->kobj, NULL, "degraded");
> kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
> +
> + /* Data integrity passthrough not supported on RAID 4, 5 and 6 */
> + if (pers->level >= 4 && pers->level <= 6)
> + return 0;
> +
> + prev = NULL;
> +
> + rdev_for_each(rdev, tmp, mddev) {
> +
> + if (prev && blk_integrity_compare(prev->bdev, rdev->bdev) < 0) {
> + printk(KERN_ERR "%s: %s %s Integrity mismatch!\n",
> + __func__, prev->bdev->bd_disk->disk_name,
> + rdev->bdev->bd_disk->disk_name);
> + return 0;
> + }
> +
> + prev = rdev;
> + }
> +
> + if (prev && bdev_get_integrity(prev->bdev)) {
> +
> + if (blk_integrity_register(disk, prev->bdev->bd_disk->integrity))
> + printk(KERN_ERR "%s: %s Could not register integrity!\n",
> + __func__, disk->disk_name);
> + else
> + printk(KERN_INFO "Enabling data integrity on %s\n",
> + disk->disk_name);
> + }
> +
> return 0;
> }
>
> @@ -3947,6 +3976,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
> printk(KERN_INFO "md: %s switched to read-only mode.\n",
> mdname(mddev));
> err = 0;
> + blk_integrity_unregister(disk);
> md_new_event(mddev);
> sysfs_notify(&mddev->kobj, NULL, "array_state");
> out:
> --
> 1.5.5.1
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-09-24 2:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-21 0:18 [PATCH] md: Add support for data integrity to MD Martin K. Petersen
2008-09-21 0:26 ` Dan Williams
2008-09-21 2:01 ` Martin K. Petersen
2008-09-21 0:28 ` Stable versions of mdadm berk walker
2008-09-21 1:07 ` Bill Davidsen
2008-09-21 1:24 ` berk walker
2008-09-24 2:46 ` Neil Brown [this message]
2008-09-29 14:51 ` [PATCH] md: Add support for data integrity to MD Martin K. Petersen
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=18649.43504.157272.351801@notabene.brown \
--to=neilb@suse.de \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).