From: NeilBrown <neilb@suse.de>
To: linux-raid <linux-raid@vger.kernel.org>
Cc: sebastian.riemer@profitbricks.com
Subject: Re: [PATCH] md: register new md sysfs file 'uuid' read-only
Date: Wed, 3 Oct 2012 08:30:31 +1000 [thread overview]
Message-ID: <20121003083031.51093f0c@notabene.brown> (raw)
In-Reply-To: <1349185330-9024-1-git-send-email-sebastian.riemer@profitbricks.com>
[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]
On Tue, 2 Oct 2012 15:42:10 +0200 Sebastian Riemer
<sebastian.riemer@profitbricks.com> wrote:
> Report the UUID of the MD array in the following format:
> xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
>
> This is useful if you don't want to wait for udev to
> identify your MD array.
If you don't want to wait for udev, run "mdadm -D --export /dev/mdwhatever"
and extract the uuid from that.
And the UUID format you mention is different from the format used by mdadm,
which makes me like the patch even less.
What problem are you trying to solve here?
NeilBrown
>
> Signed-off-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
> ---
> drivers/md/md.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 308e87b..4e654d1 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -3730,6 +3730,14 @@ static struct md_sysfs_entry md_raid_disks =
> __ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store);
>
> static ssize_t
> +uuid_show(struct mddev *mddev, char *page)
> +{
> + return sprintf(page, "%pU\n", mddev->uuid);
> +}
> +static struct md_sysfs_entry md_uuid =
> +__ATTR(uuid, S_IRUGO, uuid_show, NULL);
> +
> +static ssize_t
> chunk_size_show(struct mddev *mddev, char *page)
> {
> if (mddev->reshape_position != MaxSector &&
> @@ -4667,6 +4675,7 @@ static struct attribute *md_default_attrs[] = {
> &md_level.attr,
> &md_layout.attr,
> &md_raid_disks.attr,
> + &md_uuid.attr,
> &md_chunk_size.attr,
> &md_size.attr,
> &md_resync_start.attr,
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-10-02 22:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 13:42 [PATCH] md: register new md sysfs file 'uuid' read-only Sebastian Riemer
2012-10-02 22:30 ` NeilBrown [this message]
2012-10-08 16:32 ` Sebastian Riemer
2012-10-08 17:50 ` Phil Turmel
2012-10-09 3:02 ` NeilBrown
2012-10-09 8:54 ` Sebastian Riemer
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=20121003083031.51093f0c@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=sebastian.riemer@profitbricks.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).