All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug? Determining the holders of partitions shadowed by dm-multipath.
@ 2009-02-10  0:49 Joel Becker
  2009-02-10 14:49 ` Romanowski, John (OFT)
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Becker @ 2009-02-10  0:49 UTC (permalink / raw)
  To: dm-devel; +Cc: Sunil Mushran

Folks,
	I think this is a bug.
I	I have a device with two paths, sda and sdb.  The device is
partitioned into two partitions (sda1, sdb1) and (sda2, sdb2).  The
multipath software will create me the devices mpath1, mpath1p1, and
mpath1p2.  So far so good.
	Now, I need to detect disks used by my software.  There is a
signature on disks used by my software, so the basic algorithm is "for
each disk, check for the signature".  But, as you know, multipath makes
this fun.  You don't want to detect sda1 or sdb1, you want to detect
mpath1.  This is true no matter how the devices are arranged (LVM
devices, kpartx of loopbacks, whatever it is).  I'll use the term
"toplevel device" to describe a device that is not being used as part
of some other device.
	So, how to determine toplevel devices?  Well,
/sys/block/.../holders works for that, so I tried it.  Sure enough,
/sys/block/sda/holders and /sys/block/sdb/holders point to mpath1.  So
my software can reliably ignore sda and sdb.  But when I look at
/sys/block/sda1/holders, it is empty.
	The disk encompassing sda1 is held by another device.  By
extension, sda1 is held.  So I think it is a bug that
/sys/block/sda1/holders is empty.
	Bug or not, what is the recommended way to determine that
/dev/sda1 should not be used, because you should be using
/dev/mpath/mpath1p1 (or whatever udev name it appears as)?

Joel

-- 

Life's Little Instruction Book #510

	"Count your blessings."

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

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

end of thread, other threads:[~2009-02-11  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-02-11  8:18         ` Hannes Reinecke

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.