All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix extended partition detection
@ 2011-01-25  2:54 Dan Williams
  2011-01-27  2:58 ` Neil Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2011-01-25  2:54 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, Krzysztof Wasilewski, Przemyslaw Czarnowski

# mdadm --detail --export /dev/md127p1

Before:
MD_LEVEL=raid5
MD_DEVICES=4
MD_METADATA=0.90

After:
MD_LEVEL=raid5
MD_DEVICES=4
MD_CONTAINER=/dev/md0
MD_MEMBER=0
MD_UUID=55746a20:925d24a7:4f9bd7e2:9c9a411f

We parse the symlink target with a format:

../../block/mdXXX/mdXXXpYY

...and need the second '/' from the end of the string to read detect a
'md' device.

Reported-by: Krzysztof Wasilewski <krzysztof.wasilewski@intel.com>
Cc: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---

[ sorry for any duplicates or triplicates, I failed to notice that my
  MTA was misconfigured after an upgrade to F13, and all my mail from
  stgit was getting rejected externally. ] 

If there are any 3.1.x stable releases planned I would consider this a 
candidate as it allows custom name partitions to be created by udev 
(like /dev/md/vol1p1).  I believe this was masked by the usage of mdp 
devices.

On 3.2 it exposes a segfault as we try to get the container_content() 
of 'mbr' metadata.

 util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util.c b/util.c
index c9bdd6e..75a5e6d 100644
--- a/util.c
+++ b/util.c
@@ -1664,7 +1664,7 @@ int stat2devnum(struct stat *st)
 		link[n] = 0;
 		cp = strrchr(link, '/');
 		if (cp) *cp = 0;
-		cp = strchr(link, '/');
+		cp = strrchr(link, '/');
 		if (cp && strncmp(cp, "/md", 3) == 0)
 			return devname2devnum(cp+1);
 	}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix extended partition detection
  2011-01-25  2:54 [PATCH] fix extended partition detection Dan Williams
@ 2011-01-27  2:58 ` Neil Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Neil Brown @ 2011-01-27  2:58 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-raid, Krzysztof Wasilewski, Przemyslaw Czarnowski

On Mon, 24 Jan 2011 18:54:06 -0800
Dan Williams <dan.j.williams@intel.com> wrote:

> # mdadm --detail --export /dev/md127p1
> 
> Before:
> MD_LEVEL=raid5
> MD_DEVICES=4
> MD_METADATA=0.90
> 
> After:
> MD_LEVEL=raid5
> MD_DEVICES=4
> MD_CONTAINER=/dev/md0
> MD_MEMBER=0
> MD_UUID=55746a20:925d24a7:4f9bd7e2:9c9a411f
> 
> We parse the symlink target with a format:
> 
> ../../block/mdXXX/mdXXXpYY
> 
> ...and need the second '/' from the end of the string to read detect a
> 'md' device.
> 
> Reported-by: Krzysztof Wasilewski <krzysztof.wasilewski@intel.com>
> Cc: Przemyslaw Czarnowski
> <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Dan
> Williams <dan.j.williams@intel.com> ---
> 
> [ sorry for any duplicates or triplicates, I failed to notice that my
>   MTA was misconfigured after an upgrade to F13, and all my mail from
>   stgit was getting rejected externally. ] 
> 
> If there are any 3.1.x stable releases planned I would consider this
> a candidate as it allows custom name partitions to be created by udev 
> (like /dev/md/vol1p1).  I believe this was masked by the usage of mdp 
> devices.
> 
> On 3.2 it exposes a segfault as we try to get the container_content() 
> of 'mbr' metadata.
> 
>  util.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/util.c b/util.c
> index c9bdd6e..75a5e6d 100644
> --- a/util.c
> +++ b/util.c
> @@ -1664,7 +1664,7 @@ int stat2devnum(struct stat *st)
>  		link[n] = 0;
>  		cp = strrchr(link, '/');
>  		if (cp) *cp = 0;
> -		cp = strchr(link, '/');
> +		cp = strrchr(link, '/');
>  		if (cp && strncmp(cp, "/md", 3) == 0)
>  			return devname2devnum(cp+1);
>  	}


Thanks.  Applied for 3.2.  Hopefully I'll remember 3.1 when I get back
to my other computer..

NeilBrown

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] fix extended partition detection
       [not found] <20110114013731.14866.3356.stgit@localhost6.localdomain6>
@ 2011-01-20 11:28 ` Hawrylewicz Czarnowski, Przemyslaw
  0 siblings, 0 replies; 3+ messages in thread
From: Hawrylewicz Czarnowski, Przemyslaw @ 2011-01-20 11:28 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, Wasilewski, Krzysztof, Williams, Dan J

Neil,

Could you please take a look at this patch and possibly include it to your devel-3.2 branch?
Thanks in advance

> -----Original Message-----
> From: Williams, Dan J
> Sent: Friday, January 14, 2011 2:39 AM
> To: neilb@suse.de
> Cc: linux-raid@vger.kernel.org; Wasilewski, Krzysztof; Hawrylewicz
> Czarnowski, Przemyslaw
> Subject: [PATCH] fix extended partition detection
> 
> # mdadm --detail --export /dev/md127p1
> 
> Before:
> MD_LEVEL=raid5
> MD_DEVICES=4
> MD_METADATA=0.90
> 
> After:
> MD_LEVEL=raid5
> MD_DEVICES=4
> MD_CONTAINER=/dev/md0
> MD_MEMBER=0
> MD_UUID=55746a20:925d24a7:4f9bd7e2:9c9a411f
> 
> We parse the symlink target with a format:
> 
> ../../block/mdXXX/mdXXXpYY
> 
> ...and need the second '/' from the end of the string to read detect a
> 'md' device.
> 
> Reported-by: Krzysztof Wasilewski <krzysztof.wasilewski@intel.com>
> Cc: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> 
> If there are any 3.1.x stable releases planned I would consider this a
> candidate as it allows custom name partitions to be created by udev
> (like /dev/md/vol1p1).  I believe this was masked by the usage of mdp
> devices.
> 
> On 3.2 it exposes a segfault as we try to get the container_content() of
> 'mbr' metadata.
> 
> --
> Dan
> 
>  util.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/util.c b/util.c
> index c9bdd6e..75a5e6d 100644
> --- a/util.c
> +++ b/util.c
> @@ -1664,7 +1664,7 @@ int stat2devnum(struct stat *st)
>  		link[n] = 0;
>  		cp = strrchr(link, '/');
>  		if (cp) *cp = 0;
> -		cp = strchr(link, '/');
> +		cp = strrchr(link, '/');
>  		if (cp && strncmp(cp, "/md", 3) == 0)
>  			return devname2devnum(cp+1);
>  	}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-27  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25  2:54 [PATCH] fix extended partition detection Dan Williams
2011-01-27  2:58 ` Neil Brown
     [not found] <20110114013731.14866.3356.stgit@localhost6.localdomain6>
2011-01-20 11:28 ` Hawrylewicz Czarnowski, Przemyslaw

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.