* [PATCH 0/1] RFC: Use /dev/md/X as default name @ 2015-02-11 19:53 Jes.Sorensen 2015-02-11 19:53 ` [PATCH 1/1] mddev_create(): choose /dev/md/ name over /dev/mdX Jes.Sorensen 2015-02-18 18:12 ` [PATCH 0/1] RFC: Use /dev/md/X as default name Jes Sorensen 0 siblings, 2 replies; 10+ messages in thread From: Jes.Sorensen @ 2015-02-11 19:53 UTC (permalink / raw) To: neilb; +Cc: linux-raid, Jes Sorensen From: Jes Sorensen <Jes.Sorensen@redhat.com> I have received some issues for when creating an array using a /dev/mdX name, the matching symlink in /dev/md/X isn't created. Whereas if you create /dev/md/X, /dev/mdX is created automatically. I was trying to see if there was a better way of dealing with this, but I couldn't find one. If you have suggestions for a better solution I am all ears. Thoughts? Jes Jes Sorensen (1): mddev_create(): choose /dev/md/ name over /dev/mdX mdopen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/1] mddev_create(): choose /dev/md/ name over /dev/mdX 2015-02-11 19:53 [PATCH 0/1] RFC: Use /dev/md/X as default name Jes.Sorensen @ 2015-02-11 19:53 ` Jes.Sorensen 2015-02-18 18:12 ` [PATCH 0/1] RFC: Use /dev/md/X as default name Jes Sorensen 1 sibling, 0 replies; 10+ messages in thread From: Jes.Sorensen @ 2015-02-11 19:53 UTC (permalink / raw) To: neilb; +Cc: linux-raid, Jes Sorensen From: Jes Sorensen <Jes.Sorensen@redhat.com> /dev/mdX is created automatically if we create /dev/md/X, but /dev/md/X isn't created automatically if we create /dev/mdX. By chosing /dev/md/X as the default name from /dev/mdX, we achieve consistency when creating new arrays. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> --- mdopen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mdopen.c b/mdopen.c index 2c9d745..db75d09 100644 --- a/mdopen.c +++ b/mdopen.c @@ -338,7 +338,11 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, sprintf(devname, "/dev/%s", devnm); - if (dev && dev[0] == '/') + if (dev && strncmp(dev, "/dev/md", 7) == 0 && + dev[7] != '/' && strlen(dev) > 7) { + strcpy(chosen, "/dev/md/"); + strcpy(chosen + 8, dev + 7); + } else if (dev && dev[0] == '/') strcpy(chosen, dev); else if (cname[0] == 0) strcpy(chosen, devname); -- 2.1.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-02-11 19:53 [PATCH 0/1] RFC: Use /dev/md/X as default name Jes.Sorensen 2015-02-11 19:53 ` [PATCH 1/1] mddev_create(): choose /dev/md/ name over /dev/mdX Jes.Sorensen @ 2015-02-18 18:12 ` Jes Sorensen 2015-02-18 21:37 ` NeilBrown 1 sibling, 1 reply; 10+ messages in thread From: Jes Sorensen @ 2015-02-18 18:12 UTC (permalink / raw) To: neilb; +Cc: linux-raid Jes.Sorensen@redhat.com writes: > From: Jes Sorensen <Jes.Sorensen@redhat.com> > > I have received some issues for when creating an array using a > /dev/mdX name, the matching symlink in /dev/md/X isn't > created. Whereas if you create /dev/md/X, /dev/mdX is created > automatically. > > I was trying to see if there was a better way of dealing with this, > but I couldn't find one. If you have suggestions for a better solution > I am all ears. > > Thoughts? Hi Neil, Any thoughts on this one? Cheers, Jes > > Jes > > Jes Sorensen (1): > mddev_create(): choose /dev/md/ name over /dev/mdX > > mdopen.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-02-18 18:12 ` [PATCH 0/1] RFC: Use /dev/md/X as default name Jes Sorensen @ 2015-02-18 21:37 ` NeilBrown 2015-02-18 22:11 ` Jes Sorensen 0 siblings, 1 reply; 10+ messages in thread From: NeilBrown @ 2015-02-18 21:37 UTC (permalink / raw) To: Jes Sorensen; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 1512 bytes --] On Wed, 18 Feb 2015 13:12:09 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> wrote: > Jes.Sorensen@redhat.com writes: > > From: Jes Sorensen <Jes.Sorensen@redhat.com> > > > > I have received some issues for when creating an array using a > > /dev/mdX name, the matching symlink in /dev/md/X isn't > > created. Whereas if you create /dev/md/X, /dev/mdX is created > > automatically. > > > > I was trying to see if there was a better way of dealing with this, > > but I couldn't find one. If you have suggestions for a better solution > > I am all ears. > > > > Thoughts? > > Hi Neil, > > Any thoughts on this one? Thanks for the reminder.... I'm not sure that I really see the problem. "I ask it to create /dev/mdX and it doesn't create /dev/md/X". Well ... no. You didn't ask it to. If you want it to create /dev/md/X, then ... ask it to. /dev/mdX is the canonical name. It always gets created. /dev/md/X is a convenient alias. It gets created if requested. Is there really a problem here worth solving? Maybe I missed something. NeilBrown > > Cheers, > Jes > > > > > Jes > > > > Jes Sorensen (1): > > mddev_create(): choose /dev/md/ name over /dev/mdX > > > > mdopen.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > -- > 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 [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 811 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-02-18 21:37 ` NeilBrown @ 2015-02-18 22:11 ` Jes Sorensen 2015-02-18 22:32 ` NeilBrown 0 siblings, 1 reply; 10+ messages in thread From: Jes Sorensen @ 2015-02-18 22:11 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid NeilBrown <neilb@suse.de> writes: > On Wed, 18 Feb 2015 13:12:09 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> > wrote: > >> Jes.Sorensen@redhat.com writes: >> > From: Jes Sorensen <Jes.Sorensen@redhat.com> >> > >> > I have received some issues for when creating an array using a >> > /dev/mdX name, the matching symlink in /dev/md/X isn't >> > created. Whereas if you create /dev/md/X, /dev/mdX is created >> > automatically. >> > >> > I was trying to see if there was a better way of dealing with this, >> > but I couldn't find one. If you have suggestions for a better solution >> > I am all ears. >> > >> > Thoughts? >> >> Hi Neil, >> >> Any thoughts on this one? > > Thanks for the reminder.... > > I'm not sure that I really see the problem. > > "I ask it to create /dev/mdX and it doesn't create /dev/md/X". > > Well ... no. You didn't ask it to. If you want it to create /dev/md/X, > then ... ask it to. > > /dev/mdX is the canonical name. It always gets created. > /dev/md/X is a convenient alias. It gets created if requested. > > Is there really a problem here worth solving? > > Maybe I missed something. I have had complaints in Fedora from the installer people that they rely on the /dev/md/ name being created when they create a new device. It is also inconsistent because /dev/md/<X> will be created if you run 'mdadm -As' later on. I don't see it as a major issue, but I can see why it is frustrating for some and I think there is something to be said for being consistent in behavior. Cheers, Jes ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-02-18 22:11 ` Jes Sorensen @ 2015-02-18 22:32 ` NeilBrown 2015-03-02 16:32 ` Jes Sorensen 0 siblings, 1 reply; 10+ messages in thread From: NeilBrown @ 2015-02-18 22:32 UTC (permalink / raw) To: Jes Sorensen; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 2738 bytes --] On Wed, 18 Feb 2015 17:11:33 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> wrote: > NeilBrown <neilb@suse.de> writes: > > On Wed, 18 Feb 2015 13:12:09 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> > > wrote: > > > >> Jes.Sorensen@redhat.com writes: > >> > From: Jes Sorensen <Jes.Sorensen@redhat.com> > >> > > >> > I have received some issues for when creating an array using a > >> > /dev/mdX name, the matching symlink in /dev/md/X isn't > >> > created. Whereas if you create /dev/md/X, /dev/mdX is created > >> > automatically. > >> > > >> > I was trying to see if there was a better way of dealing with this, > >> > but I couldn't find one. If you have suggestions for a better solution > >> > I am all ears. > >> > > >> > Thoughts? > >> > >> Hi Neil, > >> > >> Any thoughts on this one? > > > > Thanks for the reminder.... > > > > I'm not sure that I really see the problem. > > > > "I ask it to create /dev/mdX and it doesn't create /dev/md/X". > > > > Well ... no. You didn't ask it to. If you want it to create /dev/md/X, > > then ... ask it to. > > > > /dev/mdX is the canonical name. It always gets created. > > /dev/md/X is a convenient alias. It gets created if requested. > > > > Is there really a problem here worth solving? > > > > Maybe I missed something. > > I have had complaints in Fedora from the installer people that they rely > on the /dev/md/ name being created when they create a new device. It is > also inconsistent because /dev/md/<X> will be created if you run > 'mdadm -As' later on. If they rely on the /dev/md/ name being created, then surely they should ask for it to be created. Is it really harder to run "mdadm -C /dev/md/0" than "mdadm -C /dev/md0" ?? If you create an array as "/dev/md0", then after subsequent "mdadm -As" /dev/md0 will exist. If you create an array as "/dev/md/0", then after subsequent mdadm -As", /dev/md/0 will exist. The fact that something unasked for also exists is a bonus. > > I don't see it as a major issue, but I can see why it is frustrating for > some and I think there is something to be said for being consistent in > behavior. I think the behaviour is perfectly consistent. It just follows rules that are slightly less trivial that some people appear to want. However.... If you changed mp = map_by_uuid(&map, info->uuid); if (mp && mp->path && strncmp(mp->path, "/dev/md/", 8) == 0) { printf("MD_DEVNAME="); print_escape(mp->path+8); putchar('\n'); } in Detail.c so that when mp->path were "/dev/md0", MD_DEVNAME became "0", then you should get the result that you are after, and I probably wouldn't object to the patch. NeilBrown [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 811 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-02-18 22:32 ` NeilBrown @ 2015-03-02 16:32 ` Jes Sorensen 2015-03-02 21:43 ` NeilBrown 0 siblings, 1 reply; 10+ messages in thread From: Jes Sorensen @ 2015-03-02 16:32 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid NeilBrown <neilb@suse.de> writes: > On Wed, 18 Feb 2015 17:11:33 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> > wrote: > >> NeilBrown <neilb@suse.de> writes: >> > On Wed, 18 Feb 2015 13:12:09 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> >> > wrote: >> > >> >> Jes.Sorensen@redhat.com writes: >> >> > From: Jes Sorensen <Jes.Sorensen@redhat.com> >> >> > >> >> > I have received some issues for when creating an array using a >> >> > /dev/mdX name, the matching symlink in /dev/md/X isn't >> >> > created. Whereas if you create /dev/md/X, /dev/mdX is created >> >> > automatically. >> >> > >> >> > I was trying to see if there was a better way of dealing with this, >> >> > but I couldn't find one. If you have suggestions for a better solution >> >> > I am all ears. >> >> > >> >> > Thoughts? >> >> >> >> Hi Neil, >> >> >> >> Any thoughts on this one? >> > >> > Thanks for the reminder.... >> > >> > I'm not sure that I really see the problem. >> > >> > "I ask it to create /dev/mdX and it doesn't create /dev/md/X". >> > >> > Well ... no. You didn't ask it to. If you want it to create /dev/md/X, >> > then ... ask it to. >> > >> > /dev/mdX is the canonical name. It always gets created. >> > /dev/md/X is a convenient alias. It gets created if requested. >> > >> > Is there really a problem here worth solving? >> > >> > Maybe I missed something. >> >> I have had complaints in Fedora from the installer people that they rely >> on the /dev/md/ name being created when they create a new device. It is >> also inconsistent because /dev/md/<X> will be created if you run >> 'mdadm -As' later on. > > If they rely on the /dev/md/ name being created, then surely they should ask > for it to be created. > Is it really harder to run "mdadm -C /dev/md/0" than "mdadm -C /dev/md0" ?? > > If you create an array as "/dev/md0", then after subsequent "mdadm > -As" /dev/md0 will exist. > If you create an array as "/dev/md/0", then after subsequent mdadm > -As", /dev/md/0 will exist. > > The fact that something unasked for also exists is a bonus. > >> >> I don't see it as a major issue, but I can see why it is frustrating for >> some and I think there is something to be said for being consistent in >> behavior. > > I think the behaviour is perfectly consistent. It just follows rules that > are slightly less trivial that some people appear to want. > > However.... > If you changed > > mp = map_by_uuid(&map, info->uuid); > if (mp && mp->path && > strncmp(mp->path, "/dev/md/", 8) == 0) { > printf("MD_DEVNAME="); > print_escape(mp->path+8); > putchar('\n'); > } > > > in Detail.c so that when mp->path were "/dev/md0", MD_DEVNAME became "0", > then you should get the result that you are after, and I probably wouldn't > object to the patch. Neil, Finally had time to go back and look at this - I don't quite understand your request here. As far as I can see, the above code isn't run at all during device creation, so I don't get how modifying it as you suggest will make /dev/md/111 appear if I create /dev/md111? Cheers, Jes ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-03-02 16:32 ` Jes Sorensen @ 2015-03-02 21:43 ` NeilBrown 2015-03-04 15:57 ` Jes Sorensen 0 siblings, 1 reply; 10+ messages in thread From: NeilBrown @ 2015-03-02 21:43 UTC (permalink / raw) To: Jes Sorensen; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 3993 bytes --] On Mon, 02 Mar 2015 11:32:16 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> wrote: > NeilBrown <neilb@suse.de> writes: > > On Wed, 18 Feb 2015 17:11:33 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> > > wrote: > > > >> NeilBrown <neilb@suse.de> writes: > >> > On Wed, 18 Feb 2015 13:12:09 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> > >> > wrote: > >> > > >> >> Jes.Sorensen@redhat.com writes: > >> >> > From: Jes Sorensen <Jes.Sorensen@redhat.com> > >> >> > > >> >> > I have received some issues for when creating an array using a > >> >> > /dev/mdX name, the matching symlink in /dev/md/X isn't > >> >> > created. Whereas if you create /dev/md/X, /dev/mdX is created > >> >> > automatically. > >> >> > > >> >> > I was trying to see if there was a better way of dealing with this, > >> >> > but I couldn't find one. If you have suggestions for a better solution > >> >> > I am all ears. > >> >> > > >> >> > Thoughts? > >> >> > >> >> Hi Neil, > >> >> > >> >> Any thoughts on this one? > >> > > >> > Thanks for the reminder.... > >> > > >> > I'm not sure that I really see the problem. > >> > > >> > "I ask it to create /dev/mdX and it doesn't create /dev/md/X". > >> > > >> > Well ... no. You didn't ask it to. If you want it to create /dev/md/X, > >> > then ... ask it to. > >> > > >> > /dev/mdX is the canonical name. It always gets created. > >> > /dev/md/X is a convenient alias. It gets created if requested. > >> > > >> > Is there really a problem here worth solving? > >> > > >> > Maybe I missed something. > >> > >> I have had complaints in Fedora from the installer people that they rely > >> on the /dev/md/ name being created when they create a new device. It is > >> also inconsistent because /dev/md/<X> will be created if you run > >> 'mdadm -As' later on. > > > > If they rely on the /dev/md/ name being created, then surely they should ask > > for it to be created. > > Is it really harder to run "mdadm -C /dev/md/0" than "mdadm -C /dev/md0" ?? > > > > If you create an array as "/dev/md0", then after subsequent "mdadm > > -As" /dev/md0 will exist. > > If you create an array as "/dev/md/0", then after subsequent mdadm > > -As", /dev/md/0 will exist. > > > > The fact that something unasked for also exists is a bonus. > > > >> > >> I don't see it as a major issue, but I can see why it is frustrating for > >> some and I think there is something to be said for being consistent in > >> behavior. > > > > I think the behaviour is perfectly consistent. It just follows rules that > > are slightly less trivial that some people appear to want. > > > > However.... > > If you changed > > > > mp = map_by_uuid(&map, info->uuid); > > if (mp && mp->path && > > strncmp(mp->path, "/dev/md/", 8) == 0) { > > printf("MD_DEVNAME="); > > print_escape(mp->path+8); > > putchar('\n'); > > } > > > > > > in Detail.c so that when mp->path were "/dev/md0", MD_DEVNAME became "0", > > then you should get the result that you are after, and I probably wouldn't > > object to the patch. > > Neil, > > Finally had time to go back and look at this - I don't quite understand > your request here. > > As far as I can see, the above code isn't run at all during device > creation, so I don't get how modifying it as you suggest will make > /dev/md/111 appear if I create /dev/md111? > > Cheers, > Jes Wheels within wheels of deception and indirection.... mdadm doesn't create the devices directly, udev does that. IMPORT{program}="BINDIR/mdadm --detail --export $devnode" ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" So the symlink from /dev/md gets created iff "mdadm --detail --export" reports an MD_DEVNAME. Hence the change suggested. mdadm *can* create the devices itself, but only if udev isn't running, or mdamd has been explicitly told to ignore udev. Normally that doesn't happen. NeilBrown [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 811 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-03-02 21:43 ` NeilBrown @ 2015-03-04 15:57 ` Jes Sorensen 2015-03-05 14:56 ` Jes Sorensen 0 siblings, 1 reply; 10+ messages in thread From: Jes Sorensen @ 2015-03-04 15:57 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid NeilBrown <neilb@suse.de> writes: > On Mon, 02 Mar 2015 11:32:16 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> >> Neil, >> >> Finally had time to go back and look at this - I don't quite understand >> your request here. >> >> As far as I can see, the above code isn't run at all during device >> creation, so I don't get how modifying it as you suggest will make >> /dev/md/111 appear if I create /dev/md111? >> >> Cheers, >> Jes > > Wheels within wheels of deception and indirection.... > > mdadm doesn't create the devices directly, udev does that. > > IMPORT{program}="BINDIR/mdadm --detail --export $devnode" > ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" > > > So the symlink from /dev/md gets created iff "mdadm --detail --export" > reports an MD_DEVNAME. > > Hence the change suggested. > > mdadm *can* create the devices itself, but only if udev isn't running, or > mdamd has been explicitly told to ignore udev. Normally that doesn't happen. Ahhh, I didn't see anything happening on my system, but it may be the RHEL/Fedora udev rules file is missing something. I'll have to take a closer look there! Thanks! Jes ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/1] RFC: Use /dev/md/X as default name 2015-03-04 15:57 ` Jes Sorensen @ 2015-03-05 14:56 ` Jes Sorensen 0 siblings, 0 replies; 10+ messages in thread From: Jes Sorensen @ 2015-03-05 14:56 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid Jes Sorensen <Jes.Sorensen@redhat.com> writes: > NeilBrown <neilb@suse.de> writes: >> On Mon, 02 Mar 2015 11:32:16 -0500 Jes Sorensen <Jes.Sorensen@redhat.com> >>> Neil, >>> >>> Finally had time to go back and look at this - I don't quite understand >>> your request here. >>> >>> As far as I can see, the above code isn't run at all during device >>> creation, so I don't get how modifying it as you suggest will make >>> /dev/md/111 appear if I create /dev/md111? >>> >>> Cheers, >>> Jes >> >> Wheels within wheels of deception and indirection.... >> >> mdadm doesn't create the devices directly, udev does that. >> >> IMPORT{program}="BINDIR/mdadm --detail --export $devnode" >> ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" >> >> >> So the symlink from /dev/md gets created iff "mdadm --detail --export" >> reports an MD_DEVNAME. >> >> Hence the change suggested. >> >> mdadm *can* create the devices itself, but only if udev isn't running, or >> mdamd has been explicitly told to ignore udev. Normally that doesn't happen. > > Ahhh, I didn't see anything happening on my system, but it may be the > RHEL/Fedora udev rules file is missing something. I'll have to take a > closer look there! Actually I remember why I didn't get that far - I added some debug code to the place you suggested I modify, and it never triggered during Create. Cheers, Jes ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-03-05 14:56 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-02-11 19:53 [PATCH 0/1] RFC: Use /dev/md/X as default name Jes.Sorensen 2015-02-11 19:53 ` [PATCH 1/1] mddev_create(): choose /dev/md/ name over /dev/mdX Jes.Sorensen 2015-02-18 18:12 ` [PATCH 0/1] RFC: Use /dev/md/X as default name Jes Sorensen 2015-02-18 21:37 ` NeilBrown 2015-02-18 22:11 ` Jes Sorensen 2015-02-18 22:32 ` NeilBrown 2015-03-02 16:32 ` Jes Sorensen 2015-03-02 21:43 ` NeilBrown 2015-03-04 15:57 ` Jes Sorensen 2015-03-05 14:56 ` Jes Sorensen
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).