All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: Bug? Determining the holders of partitions shadowed by dm-multipath.
Date: Wed, 11 Feb 2009 00:03:34 -0800	[thread overview]
Message-ID: <20090211080334.GH9512@mail.oracle.com> (raw)
In-Reply-To: <49927F04.3070404@suse.de>

On Wed, Feb 11, 2009 at 08:32:20AM +0100, Hannes Reinecke wrote:
> Hi Joel,
>
> Joel Becker wrote:
>> On Tue, Feb 10, 2009 at 09:49:58AM -0500, Romanowski, John (OFT) wrote:
>>> my sles10sp2 at 2.6.16.60-0.29-default doesn't have the /sys/block/.../holders but
>>> I've used major:minor device numbers from commands
>>> dmsetup ls
>>> and
>>> dmsetup deps
>>> to resolve such device relationships.
>>>
>>> A 'dmsetup ls' device number that isn't listed in 'dmsetup deps' device numbers is a top-level device. Example below: mproot-part1 (dev 253:3, a partition of mp device 253:2) isn't listed as a dependency of any device. Likewise each listed LVM volume isn't listed as a dependency of any device; example- rootvg-tmp 253:10
>>
>> 	Sure, but a /dev/sda2 won't show up in dmsetup output anywhere.
>> That's kind of my point.
>>
> Well, yes.
> That's because you have _two_ parent-child relationship in sysfs.
>
> The one (as you already noted) is the holders / slaves directories in sysfs.
> However, partitions are handled differently; they are listed under
>
> /sys/block/sda/sda2
>
> (note the subdir) and do not appear under holders / slaves. So the correct algorithm
> is to
> a) check the holders / slaves
> and
> b) check if the parent directory starts with the same name and if so, check for
> the holders / slaves relationship there.

	Why not just setup holders in sda2?  It's held, after all.
It's just very counterintuitive to look at an empty holders and discover
that it's empty yet held.
	Btw, do we absolutely guarantee that all block devices, forever,
will have partitions in sysfs named
"/sys/block/<parent>/<parent><more>"?

Joel

-- 

Life's Little Instruction Book #139

	"Never deprive someone of hope; it might be all they have."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2009-02-11  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10  0:49 Bug? Determining the holders of partitions shadowed by dm-multipath Joel Becker
2009-02-10 14:49 ` Romanowski, John (OFT)
2009-02-10 21:32   ` Joel Becker
2009-02-11  1:14     ` Romanowski, John (OFT)
2009-02-11  7:32     ` Hannes Reinecke
2009-02-11  8:03       ` Joel Becker [this message]
2009-02-11  8:18         ` Hannes Reinecke

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=20090211080334.GH9512@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=dm-devel@redhat.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 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.