public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Theodore Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, Eric Sandeen <sandeen@redhat.com>,
	mbroz@redhat.com, agk@redhat.com
Subject: Re: [PATCH] blkid: optimize dm_device_is_leaf() usage
Date: Tue, 26 Aug 2008 15:51:02 +0200	[thread overview]
Message-ID: <20080826135102.GK6029@nb.net.home> (raw)
In-Reply-To: <20080826122405.GA8720@mit.edu>

On Tue, Aug 26, 2008 at 08:24:05AM -0400, Theodore Tso wrote:
> commit 3f66ecf24e896377997b909edef040be98ac76b3
> Author: Theodore Ts'o <tytso@mit.edu>
> Date:   Tue Aug 26 08:13:56 2008 -0400
> 
>     libblkid: Optimize devicemapper support
>     
>     This commit works by removing all calls from libdevicemapper
>     altogether, and using the standard support for "normal" non-dm
>     devices.
>     
>     It depends on dm devices being placed in /dev/mapper (but the previous
>     code had this dependency anyway), and /proc/partitions containing dm
>     devices.

 Well, I see few problems:

 * /proc/partitions containing internal dm device names (e.g. dm-0).
   The libdevmapper provides translation from internal to the "real"
   names (e.g /dev/mapper/foo). I guess (hope:-) /sys provides the
   real names too.

 * we probably need to resolve dependencies for multi-path devices
   where the same FS is accessable by more than one physical device.
   If I good remember it was the original purpose for DM support 
   in libblkid.

        # mount LABEL=blabla /mnt

   has to mount the "right" device. I guess that only DM is able to
   answer which device is the "right" one ;-)

   The /sys/block/<devname>/slaves/ provides information about
   dependencies.

 I see these two things as critical for fsck, mount, ...

>  
> +/* Directories where we will try to search for device names */
> +static const char *dirlist[] = { "/dev", "/dev/mapper", "/devfs", "/devices", NULL };

I think "/dev/mapper" does not make any sense here, ...because the
names from /proc/partitions are in dm-<N> format, but the names in
/dev/mapper uses different format.

> -	if (!pri && !strncmp(ptname, "md", 2))
> -		pri = BLKID_PRI_MD;
> -	if (dev)
> -		dev->bid_pri = pri;
> +	if (dev) {
> +		if (pri)
> +			dev->bid_pri = pri;
> +		else if (!strncmp(dev->bid_name, "/dev/mapper/", 11))
> +			dev->bid_pri = BLKID_PRI_DM;

 the same problem

> +		else if (!strncmp(ptname, "md", 2))
> +			dev->bid_pri = BLKID_PRI_MD;
> + 	}
>  	return;
>  }

    Karel

-- 
 Karel Zak  <kzak@redhat.com>

  reply	other threads:[~2008-08-26 13:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-25 20:48 [PATCH] blkid: optimize dm_device_is_leaf() usage Karel Zak
2008-08-26 12:24 ` Theodore Tso
2008-08-26 13:51   ` Karel Zak [this message]
2008-08-26 14:47     ` Theodore Tso
2008-08-26 18:04       ` Theodore Tso
2008-08-26 19:44       ` Andreas Dilger
2008-08-26 20:00         ` Theodore Tso
2008-08-26 20:47       ` Karel Zak
2008-08-26 23:32         ` Theodore Tso
2008-08-27  0:19           ` Karel Zak
2008-08-27  1:21             ` Theodore Tso
2008-08-27  4:40               ` Theodore Tso
2008-08-27  8:32                 ` Karel Zak
2008-08-27  7:26             ` Andreas Dilger
2008-08-27  8:10               ` Karel Zak

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=20080826135102.GK6029@nb.net.home \
    --to=kzak@redhat.com \
    --cc=agk@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mbroz@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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